File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1161,20 +1161,20 @@ ConfigParser Objects
1161
1161
Use :meth: `read_file ` instead.
1162
1162
1163
1163
.. versionchanged :: 3.2
1164
- :meth: `readfp ` now iterates on *f * instead of calling ``f .readline() ``.
1164
+ :meth: `readfp ` now iterates on *fp * instead of calling ``fp .readline() ``.
1165
1165
1166
1166
For existing code calling :meth: `readfp ` with arguments which don't
1167
1167
support iteration, the following generator may be used as a wrapper
1168
1168
around the file-like object::
1169
1169
1170
- def readline_generator(f ):
1171
- line = f .readline()
1170
+ def readline_generator(fp ):
1171
+ line = fp .readline()
1172
1172
while line:
1173
1173
yield line
1174
- line = f .readline()
1174
+ line = fp .readline()
1175
1175
1176
- Instead of ``parser.readfp(f ) `` use
1177
- ``parser.read_file(readline_generator(f )) ``.
1176
+ Instead of ``parser.readfp(fp ) `` use
1177
+ ``parser.read_file(readline_generator(fp )) ``.
1178
1178
1179
1179
1180
1180
.. data :: MAX_INTERPOLATION_DEPTH
You can’t perform that action at this time.
0 commit comments