[Python-checkins] CVS: python/dist/src/Lib pty.py,1.9,1.10

Tim Peters tim_one@users.sourceforge.net
Sun, 13 May 2001 02:01:09 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv29154/python/dist/src/Lib

Modified Files:
	pty.py 
Log Message:
A disgusting "fix" for the test___all__ failure under Windows.


Index: pty.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/pty.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** pty.py	2001/05/11 19:15:28	1.9
--- pty.py	2001/05/13 09:01:06	1.10
***************
*** 9,12 ****
--- 9,23 ----
  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