commit | 52941a8348ee12223963a2e35d5a43c60fc2e621 | [log] [tgz] |
---|---|---|
author | Jack Jansen <jack.jansen@cwi.nl> | Wed Jan 08 16:33:16 2003 +0000 |
committer | Jack Jansen <jack.jansen@cwi.nl> | Wed Jan 08 16:33:16 2003 +0000 |
tree | 0da9c81a4a2ee9c5ef15a4ad9c823e6b1daf156d | |
parent | 27d19c40bc4d469483c0944dec1113ff2bae8eca [diff] [blame] |
Test that chmod() actually exists before calling it (it doesn't on MacOS9).
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 @@ 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