]> git.ipfire.org Git - thirdparty/libvirt.git/commit
rpcgen: use proper operators when comparing types
authorLaine Stump <laine@redhat.com>
Fri, 3 Nov 2023 23:40:32 +0000 (19:40 -0400)
committerLaine Stump <laine@redhat.com>
Mon, 6 Nov 2023 17:24:30 +0000 (12:24 -0500)
commit9953ab321e584021d5c4cd7d79b6c0ebe5097eb0
tree4d397ad77728334327d15c62ae0f9033b0ab61f3
parent72723b2b901c65c227909276b2face9a2d8a202c
rpcgen: use proper operators when comparing types

flake8 (run on all python scripts as a part of the syntax checks)
version 6.1.0 (on macOS 14) issued many complaints like this on the
new rpcgen python scripts:

[...]libvirt/scripts/rpcgen/rpcgen/lexer.py:57:17: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`

This patch changes all [type] == [type] to use "is" instead of "==",
and similarly to use "is not" instead of "!=".

(flake8 5.03, e.g. on Fedora 38, is just fine with using "==" and "!=",
but python on both likes "is" and "is not")

Fixes: commit v9.9.0-24-g8ec79e5e14
Fixes: commit v9.9.0-22-gca3f025011
Fixes: commit v9.9.0-21-g031efb691f
Fixes: commit v9.9.0-20-g8c8b97685b
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
scripts/rpcgen/rpcgen/ast.py
scripts/rpcgen/rpcgen/generator.py
scripts/rpcgen/rpcgen/lexer.py
scripts/rpcgen/rpcgen/parser.py