From: Guido van Rossum Date: Mon, 30 Sep 1996 18:50:44 +0000 (+0000) Subject: Don't die if an ok file method (e.g. fileno) doesn't exist. X-Git-Tag: v1.4~162 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dfd9cb1e121ea74aefea81ac18ed4fe09d1243df;p=thirdparty%2FPython%2Fcpython.git Don't die if an ok file method (e.g. fileno) doesn't exist. --- diff --git a/Lib/rexec.py b/Lib/rexec.py index 76e8b40ad12a..0d1b5a174522 100644 --- a/Lib/rexec.py +++ b/Lib/rexec.py @@ -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):