mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
Removed no-longer-needed convolutions to recover from damaged modules
getting left beyind in sys.modules.
This commit is contained in:
parent
1cd701732f
commit
d464838ebc
2 changed files with 0 additions and 25 deletions
11
Lib/pty.py
11
Lib/pty.py
|
@ -8,17 +8,6 @@
|
|||
|
||||
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"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue