mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
merge 3.3
This commit is contained in:
commit
8f2b6ad96f
1 changed files with 10 additions and 5 deletions
|
@ -7,8 +7,9 @@ import pickle
|
||||||
import weakref
|
import weakref
|
||||||
import errno
|
import errno
|
||||||
|
|
||||||
from test.support import (TESTFN, unlink, run_unittest, captured_output,
|
from test.support import (TESTFN, captured_output, check_impl_detail,
|
||||||
check_warnings, gc_collect, cpython_only, no_tracing)
|
check_warnings, cpython_only, gc_collect, run_unittest,
|
||||||
|
no_tracing, unlink)
|
||||||
|
|
||||||
class NaiveException(Exception):
|
class NaiveException(Exception):
|
||||||
def __init__(self, x):
|
def __init__(self, x):
|
||||||
|
@ -551,6 +552,8 @@ class ExceptionTests(unittest.TestCase):
|
||||||
e.__context__ = None
|
e.__context__ = None
|
||||||
obj = None
|
obj = None
|
||||||
obj = wr()
|
obj = wr()
|
||||||
|
# guarantee no ref cycles on CPython (don't gc_collect)
|
||||||
|
if check_impl_detail(cpython=False):
|
||||||
gc_collect()
|
gc_collect()
|
||||||
self.assertTrue(obj is None, "%s" % obj)
|
self.assertTrue(obj is None, "%s" % obj)
|
||||||
|
|
||||||
|
@ -568,6 +571,7 @@ class ExceptionTests(unittest.TestCase):
|
||||||
except MyException:
|
except MyException:
|
||||||
pass
|
pass
|
||||||
obj = None
|
obj = None
|
||||||
|
if check_impl_detail(cpython=False):
|
||||||
gc_collect()
|
gc_collect()
|
||||||
obj = wr()
|
obj = wr()
|
||||||
self.assertTrue(obj is None, "%s" % obj)
|
self.assertTrue(obj is None, "%s" % obj)
|
||||||
|
@ -583,6 +587,7 @@ class ExceptionTests(unittest.TestCase):
|
||||||
with Context():
|
with Context():
|
||||||
inner_raising_func()
|
inner_raising_func()
|
||||||
obj = None
|
obj = None
|
||||||
|
if check_impl_detail(cpython=False):
|
||||||
gc_collect()
|
gc_collect()
|
||||||
obj = wr()
|
obj = wr()
|
||||||
self.assertTrue(obj is None, "%s" % obj)
|
self.assertTrue(obj is None, "%s" % obj)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue