diff options
author | Raymond Hettinger <python@rcn.com> | 2005-03-04 04:47:04 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2005-03-04 04:47:04 (GMT) |
commit | ace3f61994a7ea5e9284d4297a5a90307be23179 (patch) | |
tree | e6e7884121ce74c8d39be6b11c36939126b93765 /Lib | |
parent | f05d1c0099fa3f5a46b0d9b0eb709db3bbb6cf2f (diff) | |
download | cpython-ace3f61994a7ea5e9284d4297a5a90307be23179.zip cpython-ace3f61994a7ea5e9284d4297a5a90307be23179.tar.gz cpython-ace3f61994a7ea5e9284d4297a5a90307be23179.tar.bz2 |
Convert "__init__ should return None" from an exception to a warning.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_descr.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index 26df0f2..4af59b0 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -3965,17 +3965,23 @@ def vicious_descriptor_nonsense(): import gc; gc.collect() vereq(hasattr(c, 'attr'), False) +import warnings + def test_init(): # SF 1155938 class Foo(object): def __init__(self): return 10 + + oldfilters = warnings.filters + warnings.filterwarnings("error", category=RuntimeWarning) try: Foo() - except TypeError: + except RuntimeWarning: pass else: raise TestFailed, "did not test __init__() for None return" + warnings.filters = oldfilters def test_main(): |