[Python-checkins] cpython (3.5): Issue #27787: Clean up weak references before checking for dangling threads

martin.panter python-checkins at python.org
Sat Aug 20 03:45:14 EDT 2016


https://hg.python.org/cpython/rev/7ddbc2263943
changeset:   102794:7ddbc2263943
branch:      3.5
parent:      102791:97b996d81c62
user:        Martin Panter <vadmium+py at gmail.com>
date:        Sat Aug 20 06:50:14 2016 +0000
summary:
  Issue #27787: Clean up weak references before checking for dangling threads

files:
  Lib/test/regrtest.py |  1 +
  Misc/NEWS            |  3 +++
  2 files changed, 4 insertions(+), 0 deletions(-)


diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -1258,6 +1258,7 @@
     def __exit__(self, exc_type, exc_val, exc_tb):
         saved_values = self.saved_values
         del self.saved_values
+        support.gc_collect()  # Some resources use weak references
         for name, get, restore in self.resource_info():
             current = get()
             original = saved_values.pop(name)
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -155,6 +155,9 @@
 Tests
 -----
 
+- Issue #27787: Call gc.collect() before checking each test for "dangling
+  threads", since the dangling threads are weak references.
+
 - Issue #27369: In test_pyexpat, avoid testing an error message detail that
   changed in Expat 2.2.0.
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list