Fix lint for updated tools

This commit is contained in:
Marko Durkovic 2021-10-21 18:00:44 +02:00 committed by Florian Friesdorf
parent 0e42f941d5
commit 4f658378eb
2 changed files with 5 additions and 3 deletions

View File

@ -31,12 +31,12 @@ def main() -> None: # pragma: no cover
for fname in files:
path = Path(root, fname)
if path.suffix == '.idl':
typs.update(get_types_from_idl(path.read_text()))
typs.update(get_types_from_idl(path.read_text(encoding='utf-8')))
elif path.suffix == '.msg':
name = path.relative_to(path.parents[2]).with_suffix('')
if '/msg/' not in str(name):
name = name.parent / 'msg' / name.name
typs.update(get_types_from_msg(path.read_text(), str(name)))
typs.update(get_types_from_msg(path.read_text(encoding='utf-8'), str(name)))
register_types(typs)
(selfdir / 'types.py').write_text(generate_python_code(typs))

View File

@ -178,7 +178,9 @@ def _comparable():
frombuffer = numpy.frombuffer
def arreq(self: MagicMock, other: Union[MagicMock, Any]) -> bool:
return (getattr(self, '_mock_wraps') == getattr(other, '_mock_wraps', other)).all()
lhs = self._mock_wraps # pylint: disable=protected-access
rhs = getattr(other, '_mock_wraps', other)
return (lhs == rhs).all()
class CNDArray(MagicMock):
"""Mock ndarray."""