mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Be more thorough in blanking out methods grabbed off of an fp.
This commit is contained in:
parent
b637680f7e
commit
e73b2bb415
1 changed files with 5 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue