Some tests did not pass on repeated calls (regrtest -R::)
Perform additional cleanup, mostly deleting from sys.modules, or clearing the warnings registry.
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index 7ea8668..b092bd9 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -683,6 +683,11 @@
     import struct, filecmp
     from distutils.dir_util import _path_created
 
+    # Clear the warnings registry, so they can be displayed again
+    for mod in sys.modules.values():
+        if hasattr(mod, '__warningregistry__'):
+            del mod.__warningregistry__
+
     # Restore some original values.
     warnings.filters[:] = fs
     copy_reg.dispatch_table.clear()