mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
Some tests did not pass on repeated calls (regrtest -R::)
Perform additional cleanup, mostly deleting from sys.modules, or clearing the warnings registry.
This commit is contained in:
parent
6f34109384
commit
607bff1ebe
7 changed files with 29 additions and 9 deletions
|
@ -683,6 +683,11 @@ def dash_R_cleanup(fs, ps, pic, abcs):
|
|||
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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue