Skip to content

Commit

Permalink
pycodestyle fixes in client
Browse files Browse the repository at this point in the history
  • Loading branch information
Roey Prat committed Oct 28, 2018
1 parent 07eacf3 commit 04784cb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion redis/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

try:
InterruptedError = InterruptedError
except:
except NameError:
InterruptedError = OSError

# For Python older than 3.5, retry EINTR.
Expand Down
3 changes: 2 additions & 1 deletion redis/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def pairs_to_dict_typed(response, type_info):
if key in type_info:
try:
value = type_info[key](value)
except:
except Exception:
# if for some reason the value can't be coerced, just use
# the string value
pass
Expand Down Expand Up @@ -326,6 +326,7 @@ def parse_zscan(response, **options):
it = iter(r)
return long(cursor), list(izip(it, imap(score_cast_func, it)))


def parse_slowlog_get(response, **options):
return [{
'id': item[0],
Expand Down
10 changes: 5 additions & 5 deletions redis/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def close(self):
try:
self.purge()
self._buffer.close()
except:
except Exception:
# issue #633 suggests the purge/close somehow raised a
# BadFileDescriptor error. Perhaps the client ran out of
# memory or something else? It's probably OK to ignore
Expand Down Expand Up @@ -602,9 +602,9 @@ def send_packed_command(self, command):
errmsg = e.args[1]
raise ConnectionError("Error %s while writing to socket. %s." %
(errno, errmsg))
except:
except Exception as e:
self.disconnect()
raise
raise e

def send_command(self, *args):
"Pack and send a command to the Redis server"
Expand All @@ -623,9 +623,9 @@ def read_response(self):
"Read the response from a previously sent command"
try:
response = self._parser.read_response()
except:
except Exception as e:
self.disconnect()
raise
raise e
if isinstance(response, ResponseError):
raise response
return response
Expand Down

0 comments on commit 04784cb

Please sign in to comment.