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

2008-03-17 Thread Guido van Rossum
Guido van Rossum <[EMAIL PROTECTED]> added the comment: Thanks! -- resolution: -> accepted status: open -> closed __ Tracker <[EMAIL PROTECTED]> __ ___

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

2008-03-17 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: On Mon, Mar 17, 2008 at 11:00 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > We still need patches to issue -3 warnings for: > - __getitem__ or __getslice__ on exception instances > I've opened a separate issue for this (see issue23

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

2008-03-17 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: On Mon, Mar 17, 2008 at 11:00 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: .. > - raising exceptions that don't derive from BaseException See patch at issue2341. __ Tracker <[EMAIL PROTECTED]>

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

2008-03-17 Thread Guido van Rossum
Guido van Rossum <[EMAIL PROTECTED]> added the comment: "except object:" will continue to be a no-op, if only for compatibility. With -3 it will issue a warning (I just checked this in, from issue2371). With -3 -Werror it will be an error. We still need patches to issue -3 warnings for: - rais

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

2008-03-17 Thread Guido van Rossum
Guido van Rossum <[EMAIL PROTECTED]> added the comment: I finally figured this out. The try/except statement is a complete red herring; the problem is in the raise statement. The behavior is the same in 2.4, 2.5 and 2.6, even though Exception is a classic class in 2.4 and a new-style class in 2

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

2008-03-17 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> 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 __metac

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

2008-03-17 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: There is also a subtle bug in the issue2371 patch: $ cat x.py try: raise ValueError except ((ValueError,),): pass $ ./python -3 x.py x.py:3: DeprecationWarning: catching classes that do not inherit from BaseException is not allo

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

2008-03-17 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: I am commenting on issue2371 patch here, so that I does not get lost in a non-showstopper issue. Taek, please reattach your patch here when you get a chance. With the additional -3 logic, code duplication between tuple and non-tuple ca

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

2008-03-17 Thread Brett Cannon
Changes by Brett Cannon <[EMAIL PROTECTED]>: -- priority: immediate -> urgent __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing lis

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

2008-03-17 Thread Brett Cannon
Changes by Brett Cannon <[EMAIL PROTECTED]>: -- priority: -> immediate title: Catching all exceptions with 'object' -> Raise a Py3K warning for catching non-BaseException exceptions __ Tracker <[EMAIL PROTECTED]> _