mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
Only catch the errors that can actually occur, as reported in bug #411881.
This commit is contained in:
parent
f3456912e4
commit
58682b7fe5
2 changed files with 9 additions and 5 deletions
|
@ -134,7 +134,7 @@ class URLopener:
|
|||
for file in self.__tempfiles:
|
||||
try:
|
||||
self.__unlink(file)
|
||||
except:
|
||||
except OSError:
|
||||
pass
|
||||
del self.__tempfiles[:]
|
||||
if self.tempcache:
|
||||
|
@ -1069,7 +1069,7 @@ def unquote(s):
|
|||
try:
|
||||
myappend(mychr(myatoi(item[:2], 16))
|
||||
+ item[2:])
|
||||
except:
|
||||
except ValueError:
|
||||
myappend('%' + item)
|
||||
else:
|
||||
myappend('%' + item)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue