merge 3.3

This commit is contained in:
Philip Jenvey 2012-11-14 14:51:44 -08:00
commit 8f2b6ad96f

View file

@ -7,8 +7,9 @@
import weakref
import errno
from test.support import (TESTFN, unlink, run_unittest, captured_output,
check_warnings, gc_collect, cpython_only, no_tracing)
from test.support import (TESTFN, captured_output, check_impl_detail,
check_warnings, cpython_only, gc_collect, run_unittest,
no_tracing, unlink)
class NaiveException(Exception):
def __init__(self, x):
@ -551,7 +552,9 @@ def inner_raising_func():
e.__context__ = None
obj = None
obj = wr()
gc_collect()
# guarantee no ref cycles on CPython (don't gc_collect)
if check_impl_detail(cpython=False):
gc_collect()
self.assertTrue(obj is None, "%s" % obj)
# Some complicated construct
@ -568,7 +571,8 @@ def inner_raising_func():
except MyException:
pass
obj = None
gc_collect()
if check_impl_detail(cpython=False):
gc_collect()
obj = wr()
self.assertTrue(obj is None, "%s" % obj)
@ -583,7 +587,8 @@ def __exit__ (self, exc_type, exc_value, exc_tb):
with Context():
inner_raising_func()
obj = None
gc_collect()
if check_impl_detail(cpython=False):
gc_collect()
obj = wr()
self.assertTrue(obj is None, "%s" % obj)