]> granicus.if.org Git - python/commitdiff
int() of a string is only expected to through ValueError, so do not use
authorFred Drake <fdrake@acm.org>
Fri, 11 May 2001 18:45:52 +0000 (18:45 +0000)
committerFred Drake <fdrake@acm.org>
Fri, 11 May 2001 18:45:52 +0000 (18:45 +0000)
a bare except clause.

Lib/htmllib.py

index 73af9f6734c09a47282ce6fe715df402da25209a..446192f5513ff027f298085edcaaf01914cec6d0 100644 (file)
@@ -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