Skip to main content

Keep fiddling with this snippet

ID
e833db4
date
2024-04-14 09:09:10+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
0a5d468
message
Keep fiddling with this snippet
changed files
1 file, 2 additions, 3 deletions

Changed files

expansions/get_directories.py (498) → expansions/get_directories.py (456)

diff --git a/expansions/get_directories.py b/expansions/get_directories.py
index fe4c53d..2366a56 100644
--- a/expansions/get_directories.py
+++ b/expansions/get_directories.py
@@ -13,9 +13,8 @@ def get_directories_under(root="."):
     if not root.is_dir():
         raise FileNotFoundError(root)
 
-    for dirpath, dirnames, _ in root.walk():
-        for d in dirnames:
-            yield dirpath / d
+    for dirpath, _, _ in root.walk():
+        yield dirpath
 
 
 for p in get_directories_under():