From 52941a8348ee12223963a2e35d5a43c60fc2e621 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 8 Jan 2003 16:33:16 +0000 Subject: Test that chmod() actually exists before calling it (it doesn't on MacOS9). --- Lib/fileinput.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- cgit v0.12