cpython: 33a1a3dd0051 (original) (raw)

--- a/Lib/os.py +++ b/Lib/os.py @@ -481,13 +481,13 @@ if {open, stat} <= supports_dir_fd and { dirs.append(name) else: nondirs.append(name)

if topdown:

--- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -853,38 +853,54 @@ class WalkTests(unittest.TestCase): # SUB11/ no kids # SUB2/ a file kid and a dirsymlink kid # tmp3

# Create stuff. os.makedirs(self.sub11_path) os.makedirs(sub2_path)

if support.can_symlink(): os.symlink(os.path.abspath(t2_path), self.link_path) os.symlink('broken', broken_link_path, True)

+ def test_walk_topdown(self): # Walk top-down. all = list(self.walk(self.walk_path))

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -22,6 +22,8 @@ Core and Builtins