summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/spack/test/util/environment.py2
-rw-r--r--lib/spack/spack/util/environment.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/spack/spack/test/util/environment.py b/lib/spack/spack/test/util/environment.py
index 233fc0ba84..d5b9d683b7 100644
--- a/lib/spack/spack/test/util/environment.py
+++ b/lib/spack/spack/test/util/environment.py
@@ -22,6 +22,8 @@ def prepare_environment_for_tests():
def test_is_system_path():
assert(envutil.is_system_path('/usr/bin'))
assert(not envutil.is_system_path('/nonsense_path/bin'))
+ assert(not envutil.is_system_path(''))
+ assert(not envutil.is_system_path(None))
test_paths = ['/usr/bin',
diff --git a/lib/spack/spack/util/environment.py b/lib/spack/spack/util/environment.py
index f0457c27b8..e0f0cbec2f 100644
--- a/lib/spack/spack/util/environment.py
+++ b/lib/spack/spack/util/environment.py
@@ -59,7 +59,7 @@ def is_system_path(path):
Returns:
True or False
"""
- return os.path.normpath(path) in system_dirs
+ return path and os.path.normpath(path) in system_dirs
def filter_system_paths(paths):