diff options
author | Anthony Sottile <asottile@umich.edu> | 2019-02-25 22:32:27 (GMT) |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2019-02-25 22:32:27 (GMT) |
commit | 8377cd4fcd0d51d86834c9b0518d29aac3b49e18 (patch) | |
tree | e8d82c3567b2d39ff0bd285d25ce2d02359ae070 /Lib/fileinput.py | |
parent | 9c3f284de598550be6687964c23fd7599e53b20e (diff) | |
download | cpython-8377cd4fcd0d51d86834c9b0518d29aac3b49e18.zip cpython-8377cd4fcd0d51d86834c9b0518d29aac3b49e18.tar.gz cpython-8377cd4fcd0d51d86834c9b0518d29aac3b49e18.tar.bz2 |
Clean up code which checked presence of os.{stat,lstat,chmod} (#11643)
Diffstat (limited to 'Lib/fileinput.py')
-rw-r--r-- | Lib/fileinput.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/fileinput.py b/Lib/fileinput.py index a7f8df3..4a71cc5 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 |