qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 08/22] qapi/parser: Use @staticmethod where appropriate


From: John Snow
Subject: [PATCH 08/22] qapi/parser: Use @staticmethod where appropriate
Date: Wed, 21 Apr 2021 23:07:06 -0400

No self, no thank you!

Signed-off-by: John Snow <jsnow@redhat.com>
---
 scripts/qapi/parser.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index 8d1fe0ddda5..f2425c0228a 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -127,7 +127,8 @@ def reject_expr_doc(doc):
                 "documentation for '%s' is not followed by the definition"
                 % doc.symbol)
 
-    def _include(self, include, info, incl_fname, previously_included):
+    @staticmethod
+    def _include(include, info, incl_fname, previously_included):
         incl_abs_fname = os.path.abspath(incl_fname)
         # catch inclusion cycle
         inf = info
@@ -148,7 +149,8 @@ def _include(self, include, info, incl_fname, 
previously_included):
                 f"can't read include file '{incl_fname}': {err.strerror}"
             ) from err
 
-    def _check_pragma_list_of_str(self, name, value, info):
+    @staticmethod
+    def _check_pragma_list_of_str(name, value, info):
         if (not isinstance(value, list)
                 or any([not isinstance(elt, str) for elt in value])):
             raise QAPISemError(
-- 
2.30.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]