mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +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
|
src = value
|
||||||
if attrname == 'width':
|
if attrname == 'width':
|
||||||
try: width = int(value)
|
try: width = int(value)
|
||||||
except: pass
|
except ValueError: pass
|
||||||
if attrname == 'height':
|
if attrname == 'height':
|
||||||
try: height = int(value)
|
try: height = int(value)
|
||||||
except: pass
|
except ValueError: pass
|
||||||
self.handle_image(src, alt, ismap, align, width, height)
|
self.handle_image(src, alt, ismap, align, width, height)
|
||||||
|
|
||||||
# --- Really Old Unofficial Deprecated Stuff
|
# --- Really Old Unofficial Deprecated Stuff
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue