mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Don't die if an ok file method (e.g. fileno) doesn't exist.
This commit is contained in:
parent
eb76b8484d
commit
dfd9cb1e12
1 changed files with 1 additions and 1 deletions
|
@ -38,7 +38,7 @@ class FileWrapper(FileBase):
|
|||
def __init__(self, f):
|
||||
self.f = f
|
||||
for m in self.ok_file_methods:
|
||||
if not hasattr(self, m):
|
||||
if not hasattr(self, m) and hasattr(f, m):
|
||||
setattr(self, m, getattr(f, m))
|
||||
|
||||
def close(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue