[issue2380] Raise a Py3K warning for catching nested tuples with non-BaseException exceptions

2008-03-17 Thread Alexander Belopolsky

New submission from Alexander Belopolsky <[EMAIL PROTECTED]>:

As of r61478, the following code fails to produce a py3k warning:

try:
   raise ValueError
except ((ValueError,object),):
   pass


which is an error for in py3k:

Traceback (most recent call last):
  File "x.py", line 3, in 
except ((ValueError,object),):
TypeError: catching classes that do not inherit from BaseException is 
not allowed

--
components: Interpreter Core
messages: 63875
nosy: belopolsky
severity: normal
status: open
title: Raise a Py3K warning for catching nested tuples with non-BaseException 
exceptions
type: behavior
versions: Python 2.6

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2380] Raise a Py3K warning for catching nested tuples with non-BaseException exceptions

2008-03-17 Thread Guido van Rossum

Changes by Guido van Rossum <[EMAIL PROTECTED]>:


--
keywords: +26backport, easy
priority:  -> low

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2380] Raise a Py3K warning for catching nested tuples with non-BaseException exceptions

2008-03-17 Thread Alexander Belopolsky

Changes by Alexander Belopolsky <[EMAIL PROTECTED]>:


--
keywords: +patch
Added file: http://bugs.python.org/file9720/issue2380.diff

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2380] Raise a Py3K warning for catching nested tuples with non-BaseException exceptions

2010-04-28 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
versions: +Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2380] Raise a Py3K warning for catching nested tuples with non-BaseException exceptions

2010-06-26 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2380] Raise a Py3K warning for catching nested tuples with non-BaseException exceptions

2010-12-01 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

issue2380.diff does not apply anymore.

--
assignee:  -> belopolsky
stage:  -> needs patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2380] Raise a Py3K warning for catching nested tuples with non-BaseException exceptions

2010-12-03 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Not all incompatibilities have to raise a py3k warnings; AFAIK, only those 
which are not handled by 2to3 do.

--
nosy: +benjamin.peterson, pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2380] Raise a Py3K warning for catching nested tuples with non-BaseException exceptions

2012-08-23 Thread moijes12

Changes by moijes12 :


--
nosy: +moijes12

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2380] Raise a Py3K warning for catching nested tuples with non-BaseException exceptions

2012-08-23 Thread moijes12

Changes by moijes12 :


--
nosy:  -moijes12

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2380] Raise a Py3K warning for catching nested tuples with non-BaseException exceptions

2008-05-10 Thread Bruno Gola

Bruno Gola <[EMAIL PROTECTED]> added the comment:

Should nested tuples in an except clause be a valid syntax?
like:
...
except ((ValueError, Exception), TypeError, (...)):
pass

I don't see any benefit and because of this behavior the implementation
(in Python/errors.c and in the patch attached) will use recursive function. 

I think that any objects inside a tuple in an except clause should be
treated equally (as an object), even a tuple, so the except clause above
should be an error in py3k and should produce a warning because the list
objects does not inherits BaseException.

Please, see my comment in http://bugs.python.org/issue2345, it is
related to this issue.

--
nosy: +brunogola

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com