From 51fbe518b8d7400d4df806ad9c60edcb83510e4b Mon Sep 17 00:00:00 2001 From: Stephen McDowell Date: Sun, 5 Apr 2020 15:08:13 -0400 Subject: [PATCH] verify `other.exe` attr exists before use in __eq__ (#15882) --- lib/spack/spack/util/executable.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/spack/spack/util/executable.py b/lib/spack/spack/util/executable.py index ce30e18f420..1f5fdfb7614 100644 --- a/lib/spack/spack/util/executable.py +++ b/lib/spack/spack/util/executable.py @@ -209,7 +209,7 @@ def streamify(arg, mode): istream.close() def __eq__(self, other): - return self.exe == other.exe + return hasattr(other, 'exe') and self.exe == other.exe def __neq__(self, other): return not (self == other)