summaryrefslogtreecommitdiff
path: root/redis/connection.py
diff options
context:
space:
mode:
authorKristján Valur Jónsson <sweskman@gmail.com>2022-09-29 11:03:54 +0000
committerGitHub <noreply@github.com>2022-09-29 14:03:54 +0300
commit9fe836698ca5930e39633b86839b6c1bae07237e (patch)
treee1915d05f852ff45125fb89933bc369001b48744 /redis/connection.py
parentfbf68dd217b4bf7d91a0e07ca73c8a39dfbc1066 (diff)
downloadredis-py-9fe836698ca5930e39633b86839b6c1bae07237e.tar.gz
Catch `Exception` and not `BaseException` in the `Connection` (#2104)
* Add failing unittests for passing BaseException through * Resolve failing unittest * Remove redundant checks for asyncio.CancelledError
Diffstat (limited to 'redis/connection.py')
-rwxr-xr-xredis/connection.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/redis/connection.py b/redis/connection.py
index 491df8e..2e33e31 100755
--- a/redis/connection.py
+++ b/redis/connection.py
@@ -766,7 +766,7 @@ class Connection:
errno = e.args[0]
errmsg = e.args[1]
raise ConnectionError(f"Error {errno} while writing to socket. {errmsg}.")
- except BaseException:
+ except Exception:
self.disconnect()
raise
@@ -804,7 +804,7 @@ class Connection:
except OSError as e:
self.disconnect()
raise ConnectionError(f"Error while reading from {hosterr}" f" : {e.args}")
- except BaseException:
+ except Exception:
self.disconnect()
raise