summaryrefslogtreecommitdiffstats
path: root/Lib/fileinput.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/fileinput.py')
-rw-r--r--Lib/fileinput.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/fileinput.py b/Lib/fileinput.py
index c6fc9a1..a7f8df3 100644
--- a/Lib/fileinput.py
+++ b/Lib/fileinput.py
@@ -259,6 +259,13 @@ class FileInput:
# 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: