diff options
author | Collin Winter <collinw@gmail.com> | 2007-08-30 01:19:48 (GMT) |
---|---|---|
committer | Collin Winter <collinw@gmail.com> | 2007-08-30 01:19:48 (GMT) |
commit | ce36ad8a467d914eb5c91f33835b9eaea18ee93b (patch) | |
tree | 05bf654f3359e20b455dc300bd860bba5d291c8d /Lib/fileinput.py | |
parent | 8b3febef2f96c35e9aad9db2ef499db040fdefae (diff) | |
download | cpython-ce36ad8a467d914eb5c91f33835b9eaea18ee93b.zip cpython-ce36ad8a467d914eb5c91f33835b9eaea18ee93b.tar.gz cpython-ce36ad8a467d914eb5c91f33835b9eaea18ee93b.tar.bz2 |
Raise statement normalization in Lib/.
Diffstat (limited to 'Lib/fileinput.py')
-rw-r--r-- | Lib/fileinput.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Lib/fileinput.py b/Lib/fileinput.py index 0080f78..5a423a1 100644 --- a/Lib/fileinput.py +++ b/Lib/fileinput.py @@ -99,7 +99,7 @@ def input(files=None, inplace=0, backup="", bufsize=0, """ global _state if _state and _state._file: - raise RuntimeError, "input() already active" + raise RuntimeError("input() already active") _state = FileInput(files, inplace, backup, bufsize, mode, openhook) return _state @@ -122,7 +122,7 @@ def nextfile(): last file has been read, this function has no effect. """ if not _state: - raise RuntimeError, "no active input()" + raise RuntimeError("no active input()") return _state.nextfile() def filename(): @@ -131,7 +131,7 @@ def filename(): Before the first line has been read, returns None. """ if not _state: - raise RuntimeError, "no active input()" + raise RuntimeError("no active input()") return _state.filename() def lineno(): @@ -141,7 +141,7 @@ def lineno(): of the last file has been read, returns the line number of that line. """ if not _state: - raise RuntimeError, "no active input()" + raise RuntimeError("no active input()") return _state.lineno() def filelineno(): @@ -151,7 +151,7 @@ def filelineno(): been read, returns the line number of that line within the file. """ if not _state: - raise RuntimeError, "no active input()" + raise RuntimeError("no active input()") return _state.filelineno() def fileno(): @@ -160,7 +160,7 @@ def fileno(): opened, returns -1. """ if not _state: - raise RuntimeError, "no active input()" + raise RuntimeError("no active input()") return _state.fileno() def isfirstline(): @@ -169,7 +169,7 @@ def isfirstline(): otherwise returns false. """ if not _state: - raise RuntimeError, "no active input()" + raise RuntimeError("no active input()") return _state.isfirstline() def isstdin(): @@ -178,7 +178,7 @@ def isstdin(): otherwise returns false. """ if not _state: - raise RuntimeError, "no active input()" + raise RuntimeError("no active input()") return _state.isstdin() class FileInput: @@ -257,11 +257,11 @@ class FileInput: def __getitem__(self, i): if i != self._lineno: - raise RuntimeError, "accessing lines out of order" + raise RuntimeError("accessing lines out of order") try: return self.__next__() except StopIteration: - raise IndexError, "end of input reached" + raise IndexError("end of input reached") def nextfile(self): savestdout = self._savestdout |