[Python-checkins] cpython: #18066: remove vestigial code depending on the sgi module

andrew.kuchling python-checkins at python.org
Sat Jun 1 19:53:47 CEST 2013


http://hg.python.org/cpython/rev/a678f139510b
changeset:   84009:a678f139510b
user:        Andrew Kuchling <amk at amk.ca>
date:        Sat Jun 01 13:52:30 2013 -0400
summary:
  #18066: remove vestigial code depending on the sgi module

files:
  Lib/pty.py |  13 +------------
  1 files changed, 1 insertions(+), 12 deletions(-)


diff --git a/Lib/pty.py b/Lib/pty.py
--- a/Lib/pty.py
+++ b/Lib/pty.py
@@ -47,18 +47,7 @@
     return _open_terminal()
 
 def _open_terminal():
-    """Open pty master and return (master_fd, tty_name).
-    SGI and generic BSD version, for when openpty() fails."""
-    try:
-        import sgi
-    except ImportError:
-        pass
-    else:
-        try:
-            tty_name, master_fd = sgi._getpty(os.O_RDWR, 0o666, 0)
-        except OSError as msg:
-            raise OSError(msg)
-        return master_fd, tty_name
+    """Open pty master and return (master_fd, tty_name)."""
     for x in 'pqrstuvwxyzPQRST':
         for y in '0123456789abcdef':
             pty_name = '/dev/pty' + x + y

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list