[Python-checkins] python/dist/src/Lib/test test___all__.py, 1.39, 1.40

tim_one at users.sourceforge.net tim_one at users.sourceforge.net
Mon Aug 2 05:54:38 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23318/Lib/test

Modified Files:
	test___all__.py 
Log Message:
Removed no-longer-needed convolutions to recover from damaged modules
getting left beyind in sys.modules.


Index: test___all__.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test___all__.py,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** test___all__.py	1 Jul 2004 11:15:39 -0000	1.39
--- test___all__.py	2 Aug 2004 03:54:36 -0000	1.40
***************
*** 22,39 ****
              # Silent fail here seems the best route since some modules
              # may not be available in all environments.
-             # Since an ImportError may leave a partial module object in
-             # sys.modules, get rid of that first.  Here's what happens if
-             # you don't:  importing pty fails on Windows because pty tries to
-             # import FCNTL, which doesn't exist.  That raises an ImportError,
-             # caught here.  It also leaves a partial pty module in sys.modules.
-             # So when test_pty is called later, the import of pty succeeds,
-             # but shouldn't.  As a result, test_pty crashes with an
-             # AttributeError instead of an ImportError, and regrtest interprets
-             # the latter as a test failure (ImportError is treated as "test
-             # skipped" -- which is what test_pty should say on Windows).
-             try:
-                 del sys.modules[modname]
-             except KeyError:
-                 pass
              return
          verify(hasattr(sys.modules[modname], "__all__"),
--- 22,25 ----



More information about the Python-checkins mailing list