Test that chmod() actually exists before calling it (it doesn't on MacOS9).

This commit is contained in:
Jack Jansen 2003-01-08 16:33:16 +00:00
parent 27d19c40bc
commit 52941a8348

View file

@ -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