summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2003-01-01 09:51:12 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2003-01-01 09:51:12 (GMT)
commit14e73b186414d6e67cad9924ad72fab1a7d70861 (patch)
tree4989e166bf359950f0f0d3960175e241840aeadf /Lib
parent33fb554a135720783efb18bb3b3ae382e03ea0d4 (diff)
downloadcpython-14e73b186414d6e67cad9924ad72fab1a7d70861.zip
cpython-14e73b186414d6e67cad9924ad72fab1a7d70861.tar.gz
cpython-14e73b186414d6e67cad9924ad72fab1a7d70861.tar.bz2
Expose I_ constants. Auto-detect stropts.h. Properly configure the slave terminal.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/pty.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/Lib/pty.py b/Lib/pty.py
index a08aa1b..1a41f17 100644
--- a/Lib/pty.py
+++ b/Lib/pty.py
@@ -86,7 +86,17 @@ def slave_open(tty_name):
opened filedescriptor.
Deprecated, use openpty() instead."""
- return os.open(tty_name, os.O_RDWR)
+ result = os.open(tty_name, os.O_RDWR)
+ try:
+ from fcntl import ioctl, I_PUSH
+ except ImportError:
+ return result
+ try:
+ ioctl(result, I_PUSH, "ptem")
+ ioctl(result, I_PUSH, "ldterm")
+ except IOError:
+ pass
+ return result
def fork():
"""fork() -> (pid, master_fd)