diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-03-02 09:50:31 -0800 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-03-04 12:30:44 -0800 |
commit | a7407b8782ee81d605613a3fb485cdb165a865dc (patch) | |
tree | 986e0843c66d60f5bc8ddeeb458baf7941a58553 | |
parent | f79ac4cefa576c9e1cba76c7610fe947b5cac235 (diff) | |
download | meson-a7407b8782ee81d605613a3fb485cdb165a865dc.zip meson-a7407b8782ee81d605613a3fb485cdb165a865dc.tar.gz meson-a7407b8782ee81d605613a3fb485cdb165a865dc.tar.bz2 |
mesonlib: Fix File.__eq__ to return NotImplemented
The implementation assumes another File, but doesn't properly guard
that. Let's do that guarding.
-rw-r--r-- | mesonbuild/mesonlib.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py index aa7c37c..ba267c0 100644 --- a/mesonbuild/mesonlib.py +++ b/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: |