summaryrefslogtreecommitdiffstats
path: root/Lib/fileinput.py
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2002-08-14 02:58:16 (GMT)
committerSkip Montanaro <skip@pobox.com>2002-08-14 02:58:16 (GMT)
commitcffac66393c2af89c6546ab081f9098633273a53 (patch)
tree656670e5cdd9ec9afb080de6594f2eadd01c1c61 /Lib/fileinput.py
parent72cf6a8c071864581a8a4b8d395b201de8ccfc82 (diff)
downloadcpython-cffac66393c2af89c6546ab081f9098633273a53.zip
cpython-cffac66393c2af89c6546ab081f9098633273a53.tar.gz
cpython-cffac66393c2af89c6546ab081f9098633273a53.tar.bz2
tightening up a few except: clauses
see bug 411881
Diffstat (limited to 'Lib/fileinput.py')
-rw-r--r--Lib/fileinput.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/fileinput.py b/Lib/fileinput.py
index d45aeca..f6b1329 100644
--- a/Lib/fileinput.py
+++ b/Lib/fileinput.py
@@ -261,7 +261,7 @@ class FileInput:
self._backupfilename = 0
if backupfilename and not self._backup:
try: os.unlink(backupfilename)
- except: pass
+ except OSError: pass
self._isstdin = False
self._buffer = []
@@ -301,7 +301,7 @@ class FileInput:
self._file = open(self._backupfilename, "r")
try:
perm = os.fstat(self._file.fileno()).st_mode
- except:
+ except OSError:
self._output = open(self._filename, "w")
else:
fd = os.open(self._filename,
@@ -310,7 +310,7 @@ class FileInput:
self._output = os.fdopen(fd, "w")
try:
os.chmod(self._filename, perm)
- except:
+ except OSError:
pass
self._savestdout = sys.stdout
sys.stdout = self._output