summaryrefslogtreecommitdiffstats
path: root/Lib/TERMIOS.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-02-27 21:35:40 (GMT)
committerFred Drake <fdrake@acm.org>2001-02-27 21:35:40 (GMT)
commitddd802cbd7790033fb71650281c14e93bf01cf25 (patch)
tree69b4d48870107c16ae56940e24d00ca4712cdeb3 /Lib/TERMIOS.py
parent1191d0148fc971cd8516b80f58b42910af88cd54 (diff)
downloadcpython-ddd802cbd7790033fb71650281c14e93bf01cf25.zip
cpython-ddd802cbd7790033fb71650281c14e93bf01cf25.tar.gz
cpython-ddd802cbd7790033fb71650281c14e93bf01cf25.tar.bz2
Replace all the platform-specific TERMIOS modules with a portable version
based on the termios module. The only added "feature" is the deprecation warning it spits out.
Diffstat (limited to 'Lib/TERMIOS.py')
-rw-r--r--Lib/TERMIOS.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/Lib/TERMIOS.py b/Lib/TERMIOS.py
new file mode 100644
index 0000000..0b96e55
--- /dev/null
+++ b/Lib/TERMIOS.py
@@ -0,0 +1,17 @@
+"""Backward-compatibility version of TERMIOS; export constants exported by
+termios, and issue a deprecation warning.
+"""
+
+import warnings
+warnings.warn("the TERMIOS module is deprecated; please use termios",
+ DeprecationWarning)
+
+# Ignore further deprecation warnings about this module
+warnings.filterwarnings("ignore", "", DeprecationWarning, __name__)
+
+
+# Export the constants known to the termios module:
+from termios import *
+
+# and *only* the constants:
+__all__ = [s for s in dir() if s[0] in "ABCDEFGHIJKLMNOPQRSTUVWXYZ"]