Mark Donald wrote:
I frequently have this situation:

try:
    try:
        raise Thing
    except Thing, e:
        # handle Thing exceptions
        raise
except:
    # handle all exceptions, including Thing

How about:

try:
    ... code that can raise Thing or another exception ...
except Exception, e:
    if isinstance(e, Thing):
        # handle thing
    # generic exception handling
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to