Kaydet (Commit) d23d9409 authored tarafından Guido van Rossum's avatar Guido van Rossum

Move the 'import os' in URLopener.cleanup() to inside the block

guarded by 'if self.tempcache', to reduce the likelihood of this
causing an exception when invoked during __del__...
üst f5c20575
......@@ -101,8 +101,8 @@ class URLopener:
self.cleanup()
def cleanup(self):
import os
if self.tempcache:
import os
for url in self.tempcache.keys():
try:
os.unlink(self.tempcache[url][0])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment