summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-05-11 18:45:52 (GMT)
committerFred Drake <fdrake@acm.org>2001-05-11 18:45:52 (GMT)
commit1b7e0795285b81588a1f5957b7fc045bf384783e (patch)
tree0dccd98bc99e2394aeb303b32dd8b81f3c0815d4 /Lib
parent9f9b593f8d1861ae4c888e08c61d1060c38bdb50 (diff)
downloadcpython-1b7e0795285b81588a1f5957b7fc045bf384783e.zip
cpython-1b7e0795285b81588a1f5957b7fc045bf384783e.tar.gz
cpython-1b7e0795285b81588a1f5957b7fc045bf384783e.tar.bz2
int() of a string is only expected to through ValueError, so do not use
a bare except clause.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/htmllib.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/htmllib.py b/Lib/htmllib.py
index 73af9f6..446192f 100644
--- a/Lib/htmllib.py
+++ b/Lib/htmllib.py
@@ -362,10 +362,10 @@ class HTMLParser(SGMLParser):
src = value
if attrname == 'width':
try: width = int(value)
- except: pass
+ except ValueError: pass
if attrname == 'height':
try: height = int(value)
- except: pass
+ except ValueError: pass
self.handle_image(src, alt, ismap, align, width, height)
# --- Really Old Unofficial Deprecated Stuff