]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Don't die if an ok file method (e.g. fileno) doesn't exist.
authorGuido van Rossum <guido@python.org>
Mon, 30 Sep 1996 18:50:44 +0000 (18:50 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 30 Sep 1996 18:50:44 +0000 (18:50 +0000)
Lib/rexec.py

index 76e8b40ad12ad2bc6a3bfb9ccf0417dba50036d2..0d1b5a17452265d3e722bdd58a55fc4b1ced6b89 100644 (file)
@@ -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):