From 3362ffc7ed4ea33c479f1df24fbdb25417a3584a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 28 Jun 2024 01:47:55 +0200 Subject: [PATCH] Make pylint aware of "stateless_property" decorator Mark it as defining property, so pylint knows accessing those properties is about the value, not the function. --- .pylintrc | 1 + qubes/vm/qubesvm.py | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pylintrc b/.pylintrc index 36becc484..2a180dce7 100644 --- a/.pylintrc +++ b/.pylintrc @@ -1,6 +1,7 @@ [MASTER] persistent=no ignore=tests +init-hook="import astroid.bases; astroid.bases.POSSIBLE_PROPERTIES.add('stateless_property')" [MESSAGES CONTROL] # abstract-class-little-used: see http://www.logilab.org/ticket/111138 diff --git a/qubes/vm/qubesvm.py b/qubes/vm/qubesvm.py index 04889dcc5..fa7fd3ec6 100644 --- a/qubes/vm/qubesvm.py +++ b/qubes/vm/qubesvm.py @@ -2143,7 +2143,7 @@ def is_qrexec_running(self, stubdom=False): :py:obj:`False` otherwise. :rtype: bool """ - if self.xid < 0: # pylint: disable=comparison-with-callable + if self.xid < 0: return False name = self.name + '-dm' if stubdom else self.name return os.path.exists('/var/run/qubes/qrexec.%s' % name) @@ -2281,7 +2281,6 @@ def start_time(self): def icon(self): """freedesktop icon name, suitable for use in :py:meth:`PyQt4.QtGui.QIcon.fromTheme`""" - # pylint: disable=comparison-with-callable raw_icon_name = self.label.name if self.klass == 'TemplateVM': return 'templatevm-' + raw_icon_name