diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-06-15 20:09:12 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-06-15 20:09:12 (GMT) |
commit | 27d63678a31f1adcf5f2f0f9f88d6b78e93a9c52 (patch) | |
tree | 2c0b37937bc9fc2c8507b1baf630bb97d38d2493 /Lib/test | |
parent | df6dc8f10770f92db68c69d87abe7c89774d128c (diff) | |
download | cpython-27d63678a31f1adcf5f2f0f9f88d6b78e93a9c52.zip cpython-27d63678a31f1adcf5f2f0f9f88d6b78e93a9c52.tar.gz cpython-27d63678a31f1adcf5f2f0f9f88d6b78e93a9c52.tar.bz2 |
improvements to the fix for #3114
keep the tstate consistent and a better test
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_exceptions.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index 753e33b..aa77292 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -5,8 +5,6 @@ import sys import unittest import pickle import weakref -import gc -import traceback from test.support import TESTFN, unlink, run_unittest @@ -553,9 +551,9 @@ class ExceptionTests(unittest.TestCase): del g self.assertEquals(sys.exc_info()[0], TypeError) - def test_crash_3114(self): - # Bug #3114: in its destructor, MyObject retrieves a pointer to a - # deallocated exception instance or traceback. + def test_3114(self): + # Bug #3114: in its destructor, MyObject retrieves a pointer to + # obsolete and/or deallocated objects. class MyObject: def __del__(self): nonlocal e @@ -565,10 +563,7 @@ class ExceptionTests(unittest.TestCase): raise Exception(MyObject()) except: pass - gc.collect() - [0]*10000 - # Do something with the exception and its traceback - traceback.format_exception(*e) + self.assertEquals(e, (None, None, None)) def test_main(): run_unittest(ExceptionTests) |