diff --git a/cpm_kernels/library/base.py b/cpm_kernels/library/base.py index ad319cf..6d82373 100644 --- a/cpm_kernels/library/base.py +++ b/cpm_kernels/library/base.py @@ -11,7 +11,8 @@ def lookup_dll(prefix): paths = os.environ.get("PATH", "").split(os.pathsep) for path in paths: - if not os.path.exists(path): + # if not dir, then ignore. or os.listdir(path) will raise error. + if not os.path.exists(path) or not os.path.isdir(path): continue for name in os.listdir(path): if name.startswith(prefix) and name.lower().endswith(".dll"):