diff options
author | Seth M. Larson <SethMichaelLarson@users.noreply.github.com> | 2017-03-23 17:00:17 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-23 17:00:17 -0500 |
commit | d1063eca4f6401c451bf03965e0a00feba1aa898 (patch) | |
tree | 8bc576611cfe92bdc75e2192f85522daf745d292 /redis/_compat.py | |
parent | b731bc453aaf70b952148652774a45ba812864ba (diff) | |
download | redis-py-d1063eca4f6401c451bf03965e0a00feba1aa898.tar.gz |
Implement review comments
Diffstat (limited to 'redis/_compat.py')
-rw-r--r-- | redis/_compat.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/redis/_compat.py b/redis/_compat.py index 7d0e125..93564bc 100644 --- a/redis/_compat.py +++ b/redis/_compat.py @@ -1,4 +1,5 @@ """Internal module for Python 2 backwards compatibility.""" +import errno import sys try: @@ -23,9 +24,9 @@ if sys.version_info[0] < 3 or (sys.version_info[0] == 3 and except InterruptedError as e: # Python 2 does not define InterruptedError, instead # try to catch an OSError with errno == EINTR == 4. - if hasattr(e, 'errno') and (e.errno == 4 or e.errno is None): + if hasattr(e, 'errno') and e.errno == getattr(errno, 'EINTR', 4): continue - raise e + raise # Wrapper for handling interruptable system calls. def _retryable_call(s, func, *args, **kwargs): |