]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Be more thorough in blanking out methods grabbed off of an fp.
authorBrett Cannon <brett@python.org>
Tue, 15 Mar 2011 22:45:13 +0000 (18:45 -0400)
committerBrett Cannon <brett@python.org>
Tue, 15 Mar 2011 22:45:13 +0000 (18:45 -0400)
Lib/urllib/response.py

index 985964231093c4c0e7c2fb0781ac410dee419f6d..bce2287e1875b2accee4f98e9f2b00da486e7e1b 100644 (file)
@@ -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: