summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2005-03-03 16:55:53 (GMT)
committerRaymond Hettinger <python@rcn.com>2005-03-03 16:55:53 (GMT)
commit2a06df625837867f8595de7bd334f401f6ab2a85 (patch)
treef6689d29705a89337f22a1dbf3d524d8a981d413 /Lib
parent77c8402c97092b5520ac13ad4ffa4417a08a8db9 (diff)
downloadcpython-2a06df625837867f8595de7bd334f401f6ab2a85.zip
cpython-2a06df625837867f8595de7bd334f401f6ab2a85.tar.gz
cpython-2a06df625837867f8595de7bd334f401f6ab2a85.tar.bz2
SF bug #1155938: Missing None check for __init__().
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_descr.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index f1abd3a..26df0f2 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -3965,6 +3965,18 @@ def vicious_descriptor_nonsense():
import gc; gc.collect()
vereq(hasattr(c, 'attr'), False)
+def test_init():
+ # SF 1155938
+ class Foo(object):
+ def __init__(self):
+ return 10
+ try:
+ Foo()
+ except TypeError:
+ pass
+ else:
+ raise TestFailed, "did not test __init__() for None return"
+
def test_main():
weakref_segfault() # Must be first, somehow
@@ -4058,6 +4070,7 @@ def test_main():
carloverre()
filefault()
vicious_descriptor_nonsense()
+ test_init()
if verbose: print "All OK"