diff options
author | Matthew Printz <matt.printz@rackspace.com> | 2014-02-05 17:58:13 -0600 |
---|---|---|
committer | Matthew Printz <matt.printz@rackspace.com> | 2014-02-05 17:58:13 -0600 |
commit | 4e995ddb77d7d1771a0bc79e0140b5bdff14058f (patch) | |
tree | 95c97b627547bd39a4086fe2b325b0de2373c24a /pexpect | |
parent | 40a15faffc0a0fcb07ed4e4f2240be7bd70d6d24 (diff) | |
download | pexpect-4e995ddb77d7d1771a0bc79e0140b5bdff14058f.tar.gz |
Simplifying code to use format of select.error arguments that works in both Py27 and Py3
Diffstat (limited to 'pexpect')
-rw-r--r-- | pexpect/__init__.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/pexpect/__init__.py b/pexpect/__init__.py index ecb071f..c0ad145 100644 --- a/pexpect/__init__.py +++ b/pexpect/__init__.py @@ -1687,11 +1687,7 @@ class spawn(object): return select.select(iwtd, owtd, ewtd, timeout) except select.error: err = sys.exc_info()[1] - if hasattr(err, 'errno'): - error_num = err.errno - else: - error_num = err[0] - if error_num == errno.EINTR: + if err.args[0] == errno.EINTR: # if we loop back we have to subtract the # amount of time we already waited. if timeout is not None: |