[issue2291] Raise a Py3K warning for catching non-BaseException exceptions

Alexander Belopolsky report at bugs.python.org
Tue Mar 18 01:00:22 CET 2008


Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:

Correction for msg63584: the old/new style difference example should read

"""
class x: 
    pass 
class y(x): 
    pass 
try: 
    raise y 
except y: 
    print "b" 
except: 
    print "a"
"""

As written it prints 'b', but with __metaclass__ = type, it prints 'a'.
In msg63584 I got 'a' and 'b' mixed up.

On python-dev, Guido responded that the result should be the same
regardless of the metaclass:

http://mail.python.org/pipermail/python-dev/2008-March/077713.html

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2291>
__________________________________


More information about the Python-bugs-list mailing list