summaryrefslogtreecommitdiffstats
path: root/Lib/fileinput.py
diff options
context:
space:
mode:
authorHugo van Kemenade <hugovk@users.noreply.github.com>2021-09-08 10:07:40 (GMT)
committerGitHub <noreply@github.com>2021-09-08 10:07:40 (GMT)
commitd003a5bd2505a7fa04f50504b68ba8fca67349cd (patch)
tree530dacbc66f083a0ecfcad123bab220cb6796bb5 /Lib/fileinput.py
parentcb15afcccffc6c42cbfb7456ce8db89cd2f77512 (diff)
downloadcpython-d003a5bd2505a7fa04f50504b68ba8fca67349cd.zip
cpython-d003a5bd2505a7fa04f50504b68ba8fca67349cd.tar.gz
cpython-d003a5bd2505a7fa04f50504b68ba8fca67349cd.tar.bz2
bpo-45132 Remove deprecated __getitem__ methods (GH-28225)
Remove deprecated __getitem__ methods of xml.dom.pulldom.DOMEventStream, wsgiref.util.FileWrapper and fileinput.FileInput, deprecated since Python 3.9.
Diffstat (limited to 'Lib/fileinput.py')
-rw-r--r--Lib/fileinput.py15
1 files changed, 0 insertions, 15 deletions
diff --git a/Lib/fileinput.py b/Lib/fileinput.py
index d0b3caa..9f41c18 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