diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2003-01-08 16:33:16 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2003-01-08 16:33:16 (GMT) |
commit | 52941a8348ee12223963a2e35d5a43c60fc2e621 (patch) | |
tree | 0da9c81a4a2ee9c5ef15a4ad9c823e6b1daf156d /Lib | |
parent | 27d19c40bc4d469483c0944dec1113ff2bae8eca (diff) | |
download | cpython-52941a8348ee12223963a2e35d5a43c60fc2e621.zip cpython-52941a8348ee12223963a2e35d5a43c60fc2e621.tar.gz cpython-52941a8348ee12223963a2e35d5a43c60fc2e621.tar.bz2 |
Test that chmod() actually exists before calling it (it doesn't on MacOS9).
Diffstat (limited to 'Lib')
-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 |