From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 10 Sep 2019 13:34:03 +0000 (-0700) Subject: closes bpo-25461: Update os.walk() docstring to match the online docs. (GH-11836) X-Git-Tag: v3.7.5rc1~107 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d94b762ce824e97c441f9231f0e69ef8f59beeab;p=thirdparty%2FPython%2Fcpython.git closes bpo-25461: Update os.walk() docstring to match the online docs. (GH-11836) (cherry picked from commit 734f1202a50641eb2c4bfbcd5b75247c1dc99a8f) Co-authored-by: Bernt Røskar Brenna --- diff --git a/Lib/os.py b/Lib/os.py index 41896cd11bfd..b93f95d98ede 100644 --- a/Lib/os.py +++ b/Lib/os.py @@ -300,10 +300,11 @@ def walk(top, topdown=True, onerror=None, followlinks=False): (e.g., via del or slice assignment), and walk will only recurse into the subdirectories whose names remain in dirnames; this can be used to prune the search, or to impose a specific order of visiting. Modifying dirnames when - topdown is false is ineffective, since the directories in dirnames have - already been generated by the time dirnames itself is generated. No matter - the value of topdown, the list of subdirectories is retrieved before the - tuples for the directory and its subdirectories are generated. + topdown is false has no effect on the behavior of os.walk(), since the + directories in dirnames have already been generated by the time dirnames + itself is generated. No matter the value of topdown, the list of + subdirectories is retrieved before the tuples for the directory and its + subdirectories are generated. By default errors from the os.scandir() call are ignored. If optional arg 'onerror' is specified, it should be a function; it