Skip to content

Commit 87e0dcd

Browse files
committed
Use python/Lib/xml in example
1 parent 10fcbec commit 87e0dcd

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

Doc/library/os.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3669,7 +3669,7 @@ features:
36693669

36703670
import os
36713671
from os.path import join, getsize
3672-
for root, dirs, files in os.walk('python/Lib'):
3672+
for root, dirs, files in os.walk('python/Lib/xml'):
36733673
print(root, "consumes", end=" ")
36743674
print(sum(getsize(join(root, name)) for name in files), end=" ")
36753675
print("bytes in", len(files), "non-directory files")
@@ -3730,7 +3730,7 @@ features:
37303730
``__pycache__`` subdirectory::
37313731

37323732
import os
3733-
for root, dirs, files, rootfd in os.fwalk('python/Lib'):
3733+
for root, dirs, files, rootfd in os.fwalk('python/Lib/xml'):
37343734
print(root, "consumes", end="")
37353735
print(sum([os.stat(name, dir_fd=rootfd).st_size for name in files]),
37363736
end="")

Lib/os.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ def walk(top, topdown=True, onerror=None, followlinks=False):
345345
346346
import os
347347
from os.path import join, getsize
348-
for root, dirs, files in os.walk('python/Lib'):
348+
for root, dirs, files in os.walk('python/Lib/xml'):
349349
print(root, "consumes ")
350350
print(sum(getsize(join(root, name)) for name in files), end=" ")
351351
print("bytes in", len(files), "non-directory files")
@@ -460,7 +460,7 @@ def fwalk(top=".", topdown=True, onerror=None, *, follow_symlinks=False, dir_fd=
460460
Example:
461461
462462
import os
463-
for root, dirs, files, rootfd in os.fwalk('python/Lib'):
463+
for root, dirs, files, rootfd in os.fwalk('python/Lib/xml'):
464464
print(root, "consumes", end="")
465465
print(sum(os.stat(name, dir_fd=rootfd).st_size for name in files),
466466
end="")

0 commit comments

Comments
 (0)