mesonlib: Fix File.__eq__ to return NotImplemented

The implementation assumes another File, but doesn't properly guard
that. Let's do that guarding.
pull/6736/head
Dylan Baker 5 years ago
parent f79ac4cefa
commit a7407b8782
  1. 2
      mesonbuild/mesonlib.py

@ -273,6 +273,8 @@ class File:
return self.fname.split(s)
def __eq__(self, other) -> bool:
if not isinstance(other, File):
return NotImplemented
return (self.fname, self.subdir, self.is_built) == (other.fname, other.subdir, other.is_built)
def __hash__(self) -> int:

Loading…
Cancel
Save