diff options
author | Raymond Hettinger <python@rcn.com> | 2005-03-03 16:45:19 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2005-03-03 16:45:19 (GMT) |
commit | b67cc80bb915680190eaf1c9feba8fe0799c83f8 (patch) | |
tree | 6646e6224775efdf1b4cba5a94479415d10e8019 /Lib/test/test_descr.py | |
parent | 6ce7ed23d0449daa70f396486fae3c1014d93191 (diff) | |
download | cpython-b67cc80bb915680190eaf1c9feba8fe0799c83f8.zip cpython-b67cc80bb915680190eaf1c9feba8fe0799c83f8.tar.gz cpython-b67cc80bb915680190eaf1c9feba8fe0799c83f8.tar.bz2 |
SF bug #1155938: Missing None check for __init__().
Diffstat (limited to 'Lib/test/test_descr.py')
-rw-r--r-- | Lib/test/test_descr.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index c1bd00d..7eea465 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" |