Skip to content

Commit c43f26e

Browse files
closes bpo-25461: Update os.walk() docstring to match the online docs. (GH-11836)
(cherry picked from commit 734f120) Co-authored-by: Bernt Røskar Brenna <[email protected]>
1 parent c3008dd commit c43f26e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Lib/os.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,11 @@ def walk(top, topdown=True, onerror=None, followlinks=False):
300300
(e.g., via del or slice assignment), and walk will only recurse into the
301301
subdirectories whose names remain in dirnames; this can be used to prune the
302302
search, or to impose a specific order of visiting. Modifying dirnames when
303-
topdown is false is ineffective, since the directories in dirnames have
304-
already been generated by the time dirnames itself is generated. No matter
305-
the value of topdown, the list of subdirectories is retrieved before the
306-
tuples for the directory and its subdirectories are generated.
303+
topdown is false has no effect on the behavior of os.walk(), since the
304+
directories in dirnames have already been generated by the time dirnames
305+
itself is generated. No matter the value of topdown, the list of
306+
subdirectories is retrieved before the tuples for the directory and its
307+
subdirectories are generated.
307308
308309
By default errors from the os.scandir() call are ignored. If
309310
optional arg 'onerror' is specified, it should be a function; it

0 commit comments

Comments
 (0)