Skip to content

Commit

Permalink
tools/manifestfile.py: Replace recursive glob with os.walk.
Browse files Browse the repository at this point in the history
Recursive glob isn't supported before Python 3.5.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
  • Loading branch information
jimmo committed Sep 30, 2022
1 parent 924a3e0 commit 282401d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tools/manifestfile.py
Expand Up @@ -311,14 +311,14 @@ def require(self, name, version=None, unix_ffi=False, **kwargs):
lib_dirs = ["unix-ffi"] + lib_dirs

for lib_dir in lib_dirs:
for manifest_path in glob.glob(
os.path.join(
self._path_vars["MPY_LIB_DIR"], lib_dir, "**", name, "manifest.py"
),
recursive=True,
# Search for {lib_dir}/**/{name}/manifest.py.
for root, dirnames, filenames in os.walk(
os.path.join(self._path_vars["MPY_LIB_DIR"], lib_dir)
):
self.include(manifest_path, **kwargs)
return
if os.path.basename(root) == name and "manifest.py" in filenames:
self.include(root, **kwargs)
return

raise ValueError("Library not found in local micropython-lib: {}".format(name))
else:
# TODO: HTTP request to obtain URLs from manifest.json.
Expand Down

0 comments on commit 282401d

Please sign in to comment.