From: Brett Cannon Date: Tue, 15 Mar 2011 22:45:13 +0000 (-0400) Subject: Be more thorough in blanking out methods grabbed off of an fp. X-Git-Tag: v3.3.0a1~2900 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e73b2bb41594c17e10c0bc8ae99cafca0ca00d33;p=thirdparty%2FPython%2Fcpython.git Be more thorough in blanking out methods grabbed off of an fp. --- diff --git a/Lib/urllib/response.py b/Lib/urllib/response.py index 985964231093..bce2287e1875 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: