On 02/ 1/11 04:37 PM, Danek Duvall wrote:
Shawn Walker wrote:

On 02/ 1/11 04:23 PM, Danek Duvall wrote:
Shawn Walker wrote:
...
   line 2873: s/, e:/:/

Should this actually just be "except:" rather than "except Exception:"?

If you want to catch KeyboardInterrupt too, yes.

Hm.  So then I'd want to do something like:

     except Exception, e:
         <process>
         if isinstance(e, KeyboardInterrupt):
             raise

right?

No, because as of Python 2.6, KeyboardInterrupt no longer inherits from Exception, it inherits from BaseException (see 'pydoc exceptions').

So:

except BaseException, e:
        <process>
        if isinstance(e, KeyboardInterrupt):
                raise

-Shawn
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to