summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucian Branescu Mihaila <lucian.branescu@gmail.com>2013-04-10 10:32:49 +0100
committerLucian Branescu Mihaila <lucian.branescu@gmail.com>2013-04-10 10:32:49 +0100
commita9a76239d44733738ab62b5ef5a350785cc1bfd9 (patch)
treee46ef25f18315c050c8decb3e530de6f7532fd82
parent8063b1021718f1eb1ab87530358e70fb171f5cba (diff)
downloadredis-py-a9a76239d44733738ab62b5ef5a350785cc1bfd9.tar.gz
Catch exception, not anything (which could be KeyboardInterrupt).
-rw-r--r--redis/client.py4
-rw-r--r--redis/connection.py10
2 files changed, 7 insertions, 7 deletions
diff --git a/redis/client.py b/redis/client.py
index 8db2b0e..848d06f 100644
--- a/redis/client.py
+++ b/redis/client.py
@@ -1474,7 +1474,7 @@ class PubSub(object):
if self.connection and (self.channels or self.patterns):
self.connection.disconnect()
self.reset()
- except:
+ except Exception:
pass
def reset(self):
@@ -1632,7 +1632,7 @@ class BasePipeline(object):
def __del__(self):
try:
self.reset()
- except:
+ except Exception:
pass
def __len__(self):
diff --git a/redis/connection.py b/redis/connection.py
index 93dbbe6..60dfde6 100644
--- a/redis/connection.py
+++ b/redis/connection.py
@@ -45,7 +45,7 @@ class PythonParser(object):
def __del__(self):
try:
self.on_disconnect()
- except:
+ except Exception:
pass
def on_connect(self, connection):
@@ -152,7 +152,7 @@ class HiredisParser(object):
def __del__(self):
try:
self.on_disconnect()
- except:
+ except Exception:
pass
def on_connect(self, connection):
@@ -217,7 +217,7 @@ class Connection(object):
def __del__(self):
try:
self.disconnect()
- except:
+ except Exception:
pass
def connect(self):
@@ -292,7 +292,7 @@ class Connection(object):
_errno, errmsg = e.args
raise ConnectionError("Error %s while writing to socket. %s." %
(_errno, errmsg))
- except:
+ except Exception:
self.disconnect()
raise
@@ -304,7 +304,7 @@ class Connection(object):
"Read the response from a previously sent command"
try:
response = self._parser.read_response()
- except:
+ except Exception:
self.disconnect()
raise
if isinstance(response, ResponseError):