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__...
diff --git a/Lib/urllib.py b/Lib/urllib.py
index e44f6b1..b410bd8 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -101,8 +101,8 @@
 		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])