]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
A disgusting "fix" for the test___all__ failure under Windows.
authorTim Peters <tim.peters@gmail.com>
Sun, 13 May 2001 09:01:06 +0000 (09:01 +0000)
committerTim Peters <tim.peters@gmail.com>
Sun, 13 May 2001 09:01:06 +0000 (09:01 +0000)
Lib/pty.py

index fb7edc0fea7398e0eb29153b5c57f13a6cc9932c..c9b8f0a397e7202ce69a169843340c4d155ad4d4 100644 (file)
@@ -8,6 +8,17 @@
 
 from select import select
 import os
+
+# Absurd:  import termios and then delete it.  This is to force an attempt
+# to import pty to raise an ImportError on platforms that lack termios.
+# Without this explicit import of termios here, some other module may
+# import tty first, which in turn imports termios and dies with an
+# ImportError then.  But since tty *does* exist across platforms, that
+# leaves a damaged module object for tty in sys.modules, and the import
+# of tty here then appears to work despite that the tty imported is junk.
+import termios 
+del termios
+
 import tty
 
 __all__ = ["openpty","fork","spawn"]