summaryrefslogtreecommitdiff
path: root/Lib/test/support.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2011-01-11 10:05:20 +0000
committerNick Coghlan <ncoghlan@gmail.com>2011-01-11 10:05:20 +0000
commit90be5fb8175705320c8d2cdabb35292a40257cf7 (patch)
tree5292addc88008e526b05009c99096efdddf71b68 /Lib/test/support.py
parent6655d113e66b679b5b0c8849f7c58107fdf3e22e (diff)
downloadcpython-git-90be5fb8175705320c8d2cdabb35292a40257cf7.tar.gz
Issue 10556: test_zipimport_support implicitly imports too many modules (including _ssl) to safely clobber sys.modules after each test
Diffstat (limited to 'Lib/test/support.py')
-rw-r--r--Lib/test/support.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/support.py b/Lib/test/support.py
index 152cac9bee..3d1d0f11ee 100644
--- a/Lib/test/support.py
+++ b/Lib/test/support.py
@@ -1199,6 +1199,12 @@ def modules_cleanup(oldmodules):
if k.startswith('encodings.')]
sys.modules.clear()
sys.modules.update(encodings)
+ # XXX: This kind of problem can affect more than just encodings. In particular
+ # extension modules (such as _ssl) don't cope with releoding properly.
+ # Really, test modules should be cleaning out the test specific modules they
+ # know they added (ala test_runpy) rather than relying on this function (as
+ # test_importhooks and test_pkg do currently).
+ # Implicitly imported *real* modules should be left alone (see issue 10556).
sys.modules.update(oldmodules)
#=======================================================================