diff options
Diffstat (limited to 'Lib/fileinput.py')
| -rw-r--r-- | Lib/fileinput.py | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/Lib/fileinput.py b/Lib/fileinput.py index d0b3caae5d..9f41c18510 100644 --- a/Lib/fileinput.py +++ b/Lib/fileinput.py @@ -257,21 +257,6 @@ class FileInput: self.nextfile() # repeat with next file - def __getitem__(self, i): - import warnings - warnings.warn( - "Support for indexing FileInput objects is deprecated. " - "Use iterator protocol instead.", - DeprecationWarning, - stacklevel=2 - ) - if i != self.lineno(): - raise RuntimeError("accessing lines out of order") - try: - return self.__next__() - except StopIteration: - raise IndexError("end of input reached") - def nextfile(self): savestdout = self._savestdout self._savestdout = None |
