From: Jack Jansen Date: Wed, 8 Jan 2003 16:33:16 +0000 (+0000) Subject: Test that chmod() actually exists before calling it (it doesn't on MacOS9). X-Git-Tag: v2.3c1~2518 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=52941a8348ee12223963a2e35d5a43c60fc2e621;p=thirdparty%2FPython%2Fcpython.git Test that chmod() actually exists before calling it (it doesn't on MacOS9). --- diff --git a/Lib/fileinput.py b/Lib/fileinput.py index f6b1329937a2..27ccc3bfedfd 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