summaryrefslogtreecommitdiff
path: root/Lib/ipaddress.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-05-20 10:33:40 +0300
committerSerhiy Storchaka <storchaka@gmail.com>2015-05-20 10:33:40 +0300
commitba9ac5b5c42a9bba54942211a3b00a1c3ce7bb23 (patch)
tree84491ee8c5be973ab45551b7319bb71416946827 /Lib/ipaddress.py
parent492f0277933fd5714762a99ec99fd7f97d99866a (diff)
downloadcpython-git-ba9ac5b5c42a9bba54942211a3b00a1c3ce7bb23.tar.gz
Issue #16261: Converted some bare except statements to except statements
with specified exception type. Original patch by Ramchandra Apte.
Diffstat (limited to 'Lib/ipaddress.py')
-rw-r--r--Lib/ipaddress.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/ipaddress.py b/Lib/ipaddress.py
index be1ec5209b..7469a9d6dd 100644
--- a/Lib/ipaddress.py
+++ b/Lib/ipaddress.py
@@ -135,7 +135,7 @@ def v4_int_to_packed(address):
"""
try:
return address.to_bytes(4, 'big')
- except:
+ except OverflowError:
raise ValueError("Address negative or too large for IPv4")
@@ -151,7 +151,7 @@ def v6_int_to_packed(address):
"""
try:
return address.to_bytes(16, 'big')
- except:
+ except OverflowError:
raise ValueError("Address negative or too large for IPv6")