]> granicus.if.org Git - python/commitdiff
Test that chmod() actually exists before calling it (it doesn't on MacOS9).
authorJack Jansen <jack.jansen@cwi.nl>
Wed, 8 Jan 2003 16:33:16 +0000 (16:33 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Wed, 8 Jan 2003 16:33:16 +0000 (16:33 +0000)
Lib/fileinput.py

index f6b1329937a22b2e9899d45e28d12dd108fa9c83..27ccc3bfedfd7a5b2584258b86228f4df2f89c78 100644 (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