[MERGE] Minor profiling fixes

Martin Pool mbp at sourcefrog.net
Mon Sep 10 08:57:56 BST 2007


> > Also, KeyboardInterrupt is an Exception, so that code is clearly wrong
> > regardless.

tis not!

Python 2.5.1 (r251:54863, Aug 17 2007, 18:40:36)
[GCC 4.1.3 20070812 (prerelease) (Ubuntu 4.1.2-15ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> issubclass(KeyboardInterrupt, Exception)
False
>>> issubclass(KeyboardInterrupt, BaseException)
True

> That's true. I went digging to understand why the original code I copied
> was suboptimal in this regard. Perhaps the author was getting ready for
> Python 3 where KeyboardInterrupt will not derived from Exception? See
> http://www.python.org/dev/peps/pep-0352/.
>
> I've removed the trapping of KeyboardInterrupt in my patch because you
> asked for it. I left it unchanged in commands.py because it's not wrong,
> just sub-optimal.
>
> Do you want this fully "sorted" now or can we revisit this when we add
> support for Python 3.0?

It's needed for python2.5, so please put it back.

-- 
Martin



More information about the bazaar mailing list