diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2015-05-20 07:33:40 (GMT) |
|---|---|---|
| committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-05-20 07:33:40 (GMT) |
| commit | ba9ac5b5c42a9bba54942211a3b00a1c3ce7bb23 (patch) | |
| tree | 84491ee8c5be973ab45551b7319bb71416946827 /Lib/ipaddress.py | |
| parent | 492f0277933fd5714762a99ec99fd7f97d99866a (diff) | |
| download | cpython-ba9ac5b5c42a9bba54942211a3b00a1c3ce7bb23.zip cpython-ba9ac5b5c42a9bba54942211a3b00a1c3ce7bb23.tar.gz cpython-ba9ac5b5c42a9bba54942211a3b00a1c3ce7bb23.tar.bz2 | |
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.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/ipaddress.py b/Lib/ipaddress.py index be1ec52..7469a9d 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") |
