summaryrefslogtreecommitdiff
path: root/Lib/fileinput.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/fileinput.py')
-rw-r--r--Lib/fileinput.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/fileinput.py b/Lib/fileinput.py
index a7f8df37aa..4a71cc5ff3 100644
--- a/Lib/fileinput.py
+++ b/Lib/fileinput.py
@@ -357,8 +357,7 @@ class FileInput:
fd = os.open(self._filename, mode, perm)
self._output = os.fdopen(fd, "w")
try:
- if hasattr(os, 'chmod'):
- os.chmod(self._filename, perm)
+ os.chmod(self._filename, perm)
except OSError:
pass
self._savestdout = sys.stdout