Some of the roots can be None in WASM builds

This commit is contained in:
Fabio Zadrozny 2022-11-18 09:57:22 -03:00
parent 45af79671f
commit 53cda4e36d

View file

@ -190,6 +190,8 @@ class FilesFiltering(object):
if os.path.exists(path) and os.path.basename(path) in ('site-packages', 'pip-global'):
roots.append(path)
# On WASM some of the roots may not exist, filter those out.
roots = [path for path in roots if path is not None]
roots.extend([os.path.realpath(path) for path in roots])
return sorted(set(roots))