verify other.exe attr exists before use in __eq__ (#15882)

This commit is contained in:
Stephen McDowell 2020-04-05 15:08:13 -04:00 committed by GitHub
parent 34627fcbe5
commit 51fbe518b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)