From: Fred Drake Date: Fri, 11 May 2001 18:45:52 +0000 (+0000) Subject: int() of a string is only expected to through ValueError, so do not use X-Git-Tag: v2.2a3~1813 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1b7e0795285b81588a1f5957b7fc045bf384783e;p=python int() of a string is only expected to through ValueError, so do not use a bare except clause. --- diff --git a/Lib/htmllib.py b/Lib/htmllib.py index 73af9f6734..446192f551 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