diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-25 14:47:37 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-25 14:47:37 (GMT) |
commit | f7a17b48d748e1835bcf9df86fb7fb318bb020f8 (patch) | |
tree | 403d91c57f72d6e538ce09a8037bd658bc619760 /Lib/fileinput.py | |
parent | 16bdd4120d8452e8e04b124bcdd116608c5166b0 (diff) | |
download | cpython-f7a17b48d748e1835bcf9df86fb7fb318bb020f8.zip cpython-f7a17b48d748e1835bcf9df86fb7fb318bb020f8.tar.gz cpython-f7a17b48d748e1835bcf9df86fb7fb318bb020f8.tar.bz2 |
Replace IOError with OSError (#16715)
Diffstat (limited to 'Lib/fileinput.py')
-rw-r--r-- | Lib/fileinput.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/fileinput.py b/Lib/fileinput.py index 5be0318..f9bb88a 100644 --- a/Lib/fileinput.py +++ b/Lib/fileinput.py @@ -30,7 +30,7 @@ pertaining to the last line read; nextfile() has no effect. All files are opened in text mode by default, you can override this by setting the mode parameter to input() or FileInput.__init__(). -If an I/O error occurs during opening or reading a file, the IOError +If an I/O error occurs during opening or reading a file, the OSError exception is raised. If sys.stdin is used more than once, the second and further use will @@ -328,7 +328,7 @@ class FileInput: os.unlink(self._backupfilename) except OSError: pass - # The next few lines may raise IOError + # The next few lines may raise OSError os.rename(self._filename, self._backupfilename) self._file = open(self._backupfilename, self._mode) try: @@ -350,7 +350,7 @@ class FileInput: self._savestdout = sys.stdout sys.stdout = self._output else: - # This may raise IOError + # This may raise OSError if self._openhook: self._file = self._openhook(self._filename, self._mode) else: |