comparison Lib/urllib.py @ 4566:6403c94de50d legacy-trunk

Added safeguard against failure in __del__.
author Guido van Rossum <guido@python.org>
date Wed, 27 Nov 1996 19:39:58 +0000
parents df9d1ebcf7f3
children e97528482bc6
comparison
equal deleted inserted replaced
4565:7f47e2b6c4a4 4566:6403c94de50d
67 # Note -- this is a base class for those who don't want the 67 # Note -- this is a base class for those who don't want the
68 # automatic handling of errors type 302 (relocated) and 401 68 # automatic handling of errors type 302 (relocated) and 401
69 # (authorization needed). 69 # (authorization needed).
70 ftpcache = {} 70 ftpcache = {}
71 class URLopener: 71 class URLopener:
72
73 tempcache = None # So close() in __del__() won't fail
72 74
73 # Constructor 75 # Constructor
74 def __init__(self, proxies=None): 76 def __init__(self, proxies=None):
75 if proxies is None: 77 if proxies is None:
76 proxies = getproxies() 78 proxies = getproxies()