Clean-up example of using fileinput as a context manager.
diff --git a/Doc/library/fileinput.rst b/Doc/library/fileinput.rst
index eac324d..7055f32 100644
--- a/Doc/library/fileinput.rst
+++ b/Doc/library/fileinput.rst
@@ -58,8 +58,9 @@
:keyword:`with` statement. In this example, *input* is closed after the
:keyword:`with` statement is exited, even if an exception occurs::
- with fileinput.input(files=('spam.txt', 'eggs.txt')) as input:
- process(input)
+ with fileinput.input(files=('spam.txt', 'eggs.txt')) as f:
+ for line in f:
+ process(line)
.. versionchanged:: 3.2
Can be used as a context manager.