mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
int() of a string is only expected to through ValueError, so do not use
a bare except clause.
This commit is contained in:
parent
9f9b593f8d
commit
1b7e079528
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue