diff --git a/src/mx/_impl/mx_proftool.py b/src/mx/_impl/mx_proftool.py index 6d2e361c..f4047105 100644 --- a/src/mx/_impl/mx_proftool.py +++ b/src/mx/_impl/mx_proftool.py @@ -921,6 +921,9 @@ def demangled_name(self, short_class_names: bool = False): def _which(executable): + if 'PATH' not in os.environ: + return None + for path in os.environ['PATH'].split(os.pathsep): f = os.path.join(path.strip('"'), executable) if os.path.isfile(f) and os.access(f, os.X_OK):