diff options
author | Matthew Printz <matt.printz@rackspace.com> | 2014-02-04 13:16:27 -0600 |
---|---|---|
committer | Matthew Printz <matt.printz@rackspace.com> | 2014-02-04 13:16:27 -0600 |
commit | 40a15faffc0a0fcb07ed4e4f2240be7bd70d6d24 (patch) | |
tree | b9f545676c48f6c8fa04594fc4bf0cb0f800b19c | |
parent | 1972ab52a651de11246cc2aeaee654dc0f3a8437 (diff) | |
download | pexpect-40a15faffc0a0fcb07ed4e4f2240be7bd70d6d24.tar.gz |
Fixing issue where errno does not exist on select.error
-rw-r--r-- | pexpect/__init__.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pexpect/__init__.py b/pexpect/__init__.py index a6fb875..ecb071f 100644 --- a/pexpect/__init__.py +++ b/pexpect/__init__.py @@ -1687,7 +1687,11 @@ class spawn(object): return select.select(iwtd, owtd, ewtd, timeout) except select.error: err = sys.exc_info()[1] - if err.errno == errno.EINTR: + if hasattr(err, 'errno'): + error_num = err.errno + else: + error_num = err[0] + if error_num == errno.EINTR: # if we loop back we have to subtract the # amount of time we already waited. if timeout is not None: |