mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Test that chmod() actually exists before calling it (it doesn't on MacOS9).
This commit is contained in:
parent
27d19c40bc
commit
52941a8348
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue