[issue11494] Confusing error message from warnings.warn

2011-03-20 Thread Brett Cannon

Brett Cannon br...@python.org added the comment:

I'm not crazy about the idea of adding an inspect.isclass() check simply to 
clear up this rare error message. It's still decipherable what the problem is 
from the issubclass() message.

Closing as won't fix.

--
resolution:  - wont fix
status: open - closed

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



[issue11494] Confusing error message from warnings.warn

2011-03-18 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
nosy: +brett.cannon
versions: +Python 3.1, Python 3.2, Python 3.3

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



[issue11494] Confusing error message from warnings.warn

2011-03-14 Thread Gerrit Holl

New submission from Gerrit Holl topjakl...@gmail.com:

When accidentally passing a string to warnings.warn where one should pass a 
Warning-class, the error message is rather confusing:

 $ ./python 
 Python 2.7.1+ (release27-maint:88766, Mar  8 2011, 16:51:59) 
 [GCC 4.4.5] on linux2
 Type help, copyright, credits or license for more information.
  import warnings
  warnings.warn(aaa, bbb)
 Traceback (most recent call last):
   File stdin, line 1, in module
 TypeError: issubclass() arg 1 must be a class

It would be better for the error message to say TypeError: warnings must be 
classes inherited from ... or something like that.

--
components: Interpreter Core, Library (Lib)
messages: 130800
nosy: Gerrit.Holl
priority: normal
severity: normal
status: open
title: Confusing error message from warnings.warn
type: behavior
versions: Python 2.7

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