A disgusting "fix" for the test___all__ failure under Windows.
This commit is contained in:
parent
ef8b654bbe
commit
a0599575aa
11
Lib/pty.py
11
Lib/pty.py
|
@ -8,6 +8,17 @@
|
||||||
|
|
||||||
from select import select
|
from select import select
|
||||||
import os
|
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
|
import tty
|
||||||
|
|
||||||
__all__ = ["openpty","fork","spawn"]
|
__all__ = ["openpty","fork","spawn"]
|
||||||
|
|
Loading…
Reference in New Issue