Message2688

Author pjenvey
Recipients
Date 2007-03-17.00:32:23
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
int() on None or any object that doesn't implement __int__ currently raises an AttributeError, when it should raise a TypeError:

Jython 2.3a0 on java1.5.0_07
Type "copyright", "credits" or "license" for more information.
>>> int(None)
Traceback (innermost last):
  File "<console>", line 1, in ?
AttributeError: __int__

Python 2.4.3 (#1, Mar  2 2007, 22:22:33) 
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> int(None)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: int() argument must be a string or a number

The following patch fixes this and ensures so with 2 new tests added to test_descr.py
History
Date User Action Args
2008-02-20 17:18:41adminlinkissue1682498 messages
2008-02-20 17:18:41admincreate