Expand Up
@@ -627,6 +627,7 @@ def inner_raising_func():
except MyException as e:
pass
obj = None
gc_collect() # For PyPy or other GCs.
obj = wr()
self.assertIsNone(obj)
Expand All
@@ -638,6 +639,7 @@ def inner_raising_func():
except MyException:
pass
obj = None
gc_collect() # For PyPy or other GCs.
obj = wr()
self.assertIsNone(obj)
Expand All
@@ -649,6 +651,7 @@ def inner_raising_func():
except:
pass
obj = None
gc_collect() # For PyPy or other GCs.
obj = wr()
self.assertIsNone(obj)
Expand All
@@ -661,6 +664,7 @@ def inner_raising_func():
except:
break
obj = None
gc_collect() # For PyPy or other GCs.
obj = wr()
self.assertIsNone(obj)
Expand All
@@ -679,6 +683,7 @@ def inner_raising_func():
# must clear the latter manually for our test to succeed.
e.__context__ = None
obj = None
gc_collect() # For PyPy or other GCs.
obj = wr()
# guarantee no ref cycles on CPython (don't gc_collect)
if check_impl_detail(cpython=False):
Expand Down
Expand Up
@@ -869,6 +874,7 @@ def raising_gen():
next(g)
testfunc(g)
g = obj = None
gc_collect() # For PyPy or other GCs.
obj = wr()
self.assertIsNone(obj)
Expand Down
Expand Up
@@ -922,6 +928,7 @@ def __del__(self):
raise Exception(MyObject())
except:
pass
gc_collect() # For PyPy or other GCs.
self.assertEqual(e, (None, None, None))
def test_raise_does_not_create_context_chain_cycle(self):
Expand Down
Expand Up
@@ -1335,6 +1342,7 @@ def inner():
self.assertNotEqual(wr(), None)
else:
self.fail("MemoryError not raised")
gc_collect() # For PyPy or other GCs.
self.assertEqual(wr(), None)
@no_tracing
Expand All
@@ -1355,6 +1363,7 @@ def inner():
self.assertNotEqual(wr(), None)
else:
self.fail("RecursionError not raised")
gc_collect() # For PyPy or other GCs.
self.assertEqual(wr(), None)
def test_errno_ENOTDIR(self):
Expand All
@@ -1375,6 +1384,7 @@ def __del__(self):
with support.catch_unraisable_exception() as cm:
del obj
gc_collect() # For PyPy or other GCs.
self.assertEqual(cm.unraisable.object, BrokenDel.__del__)
self.assertIsNotNone(cm.unraisable.exc_traceback)
Expand Down