diff options
-rw-r--r-- | Lib/fileinput.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/fileinput.py b/Lib/fileinput.py index f6b1329..27ccc3b 100644 --- a/Lib/fileinput.py +++ b/Lib/fileinput.py @@ -309,7 +309,8 @@ class FileInput: perm) self._output = os.fdopen(fd, "w") try: - os.chmod(self._filename, perm) + if hasattr(os, 'chmod'): + os.chmod(self._filename, perm) except OSError: pass self._savestdout = sys.stdout |