From 4635ac635813b97d68fa55fe1e15db0f3c460212 Mon Sep 17 00:00:00 2001 From: Sandro-Alessio Gierens Date: Tue, 15 Aug 2023 16:07:47 +0200 Subject: Revise iovec_t.__eq__ and vfu_dma_info_t.__eq__ to fix flake8 E721 The newer flake8 version in the arch linux job of the pull request workflow fails due to: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()` Both `__eq__` functions now use `is not` instead of `!=` for the type initial check. Signed-off-by: Sandro-Alessio Gierens --- test/py/libvfio_user.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/py/libvfio_user.py b/test/py/libvfio_user.py index 6d60798..f29b50e 100644 --- a/test/py/libvfio_user.py +++ b/test/py/libvfio_user.py @@ -315,7 +315,7 @@ class iovec_t(Structure): ] def __eq__(self, other): - if type(self) != type(other): + if type(self) is not type(other): return False return self.iov_base == other.iov_base \ and self.iov_len == other.iov_len @@ -491,7 +491,7 @@ class vfu_dma_info_t(Structure): ] def __eq__(self, other): - if type(self) != type(other): + if type(self) is not type(other): return False return self.iova == other.iova \ and self.vaddr == other.vaddr \ -- cgit v1.1