summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Kluyver <takowl@gmail.com>2014-02-13 12:11:22 -0800
committerThomas Kluyver <takowl@gmail.com>2014-02-13 12:11:22 -0800
commitd7be1bdc66df448fc055f8aa8da795224c7ce747 (patch)
tree0483d2dba27b38797aa37f0597b496e9fb4b0c0d
parenta97f580d5cdd0f479ea64d36edc164ea769d4084 (diff)
parent5a4ad4b882f23c07bf8b51c4ba1ed4229ee52e78 (diff)
downloadpexpect-d7be1bdc66df448fc055f8aa8da795224c7ce747.tar.gz
Merge pull request #40 from emaste/master
Remove workaround for bug affecting very old platforms
-rw-r--r--pexpect/__init__.py15
1 files changed, 4 insertions, 11 deletions
diff --git a/pexpect/__init__.py b/pexpect/__init__.py
index c0ad145..139a6a9 100644
--- a/pexpect/__init__.py
+++ b/pexpect/__init__.py
@@ -1558,18 +1558,11 @@ class spawn(object):
applications like vi or curses -- applications that respond to the
SIGWINCH signal. '''
- # Check for buggy platforms. Some Python versions on some platforms
- # (notably OSF1 Alpha and RedHat 7.1) truncate the value for
- # termios.TIOCSWINSZ. It is not clear why this happens.
- # These platforms don't seem to handle the signed int very well;
- # yet other platforms like OpenBSD have a large negative value for
- # TIOCSWINSZ and they don't have a truncate problem.
- # Newer versions of Linux have totally different values for TIOCSWINSZ.
- # Note that this fix is a hack.
+ # Some very old platforms have a bug that causes the value for
+ # termios.TIOCSWINSZ to be truncated. There was a hack here to work
+ # around this, but it caused problems with newer platforms so has been
+ # removed. For details see https://github.com/pexpect/pexpect/issues/39
TIOCSWINSZ = getattr(termios, 'TIOCSWINSZ', -2146929561)
- if TIOCSWINSZ == 2148037735:
- # Same bits, but with sign.
- TIOCSWINSZ = -2146929561
# Note, assume ws_xpixel and ws_ypixel are zero.
s = struct.pack('HHHH', rows, cols, 0, 0)
fcntl.ioctl(self.fileno(), TIOCSWINSZ, s)