diff options
author | Brett Cannon <brett@python.org> | 2011-03-15 22:45:13 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2011-03-15 22:45:13 (GMT) |
commit | e73b2bb41594c17e10c0bc8ae99cafca0ca00d33 (patch) | |
tree | aec60ea2c0f0ebaae095a7e3b3a36e7dd2ba01e1 | |
parent | b637680f7e4e23c59c12dd5f95c78b75a51e75f4 (diff) | |
download | cpython-e73b2bb41594c17e10c0bc8ae99cafca0ca00d33.zip cpython-e73b2bb41594c17e10c0bc8ae99cafca0ca00d33.tar.gz cpython-e73b2bb41594c17e10c0bc8ae99cafca0ca00d33.tar.bz2 |
Be more thorough in blanking out methods grabbed off of an fp.
-rw-r--r-- | Lib/urllib/response.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/urllib/response.py b/Lib/urllib/response.py index 9859642..bce2287 100644 --- a/Lib/urllib/response.py +++ b/Lib/urllib/response.py @@ -33,12 +33,15 @@ class addbase(object): id(self), self.fp) def close(self): + if self.fp: + self.fp.close() + self.fp = None self.read = None self.readline = None self.readlines = None self.fileno = None - if self.fp: self.fp.close() - self.fp = None + self.__iter__ = None + self.__next__ = None def __enter__(self): if self.fp is None: |