diff options
author | Sjoerd Mullender <sjoerd@acm.org> | 1995-08-15 11:33:39 (GMT) |
---|---|---|
committer | Sjoerd Mullender <sjoerd@acm.org> | 1995-08-15 11:33:39 (GMT) |
commit | 9c4585acfa28cd460c80b9b3ab6de5c257eaeec5 (patch) | |
tree | fe6e8b9ae1688409b79cd60962e14f8f449bde95 /Lib | |
parent | ebed45fe0fff1878a3e0af99633fe026971aed32 (diff) | |
download | cpython-9c4585acfa28cd460c80b9b3ab6de5c257eaeec5.zip cpython-9c4585acfa28cd460c80b9b3ab6de5c257eaeec5.tar.gz cpython-9c4585acfa28cd460c80b9b3ab6de5c257eaeec5.tar.bz2 |
Removed addbase.__del__ because it can't work.
If code keeps a reference to self.fp or any of its methods, you don't
want to close self.fp just because no explicit reference is kept to self.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/urllib.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py index 380a852..f83bafd 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -442,8 +442,12 @@ class addbase: def __repr__(self): return '<%s at %s whose fp = %s>' % ( self.__class__.__name__, `id(self)`, `self.fp`) - def __del__(self): - self.close() +# Removed this __del__ because it can't work like this. If a +# reference is kept to self.fp or any of its methods, but no reference +# is kept to self, we don't want to close self.fp (which would happen +# if this __del__ still existed). +# def __del__(self): +# self.close() def close(self): self.read = None self.readline = None |