[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 24/38] qapi/gen.py: Fix edge-case of _is_user_module
From: |
John Snow |
Subject: |
[PATCH v2 24/38] qapi/gen.py: Fix edge-case of _is_user_module |
Date: |
Tue, 22 Sep 2020 17:00:47 -0400 |
The edge case is that if the name is '', this expression returns a
string instead of a bool, which violates our declared type.
Signed-off-by: John Snow <jsnow@redhat.com>
---
scripts/qapi/gen.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py
index 9898d513ae..cb2b2655c3 100644
--- a/scripts/qapi/gen.py
+++ b/scripts/qapi/gen.py
@@ -251,7 +251,7 @@ def __init__(self, prefix, what, user_blurb, builtin_blurb,
pydoc):
@staticmethod
def _is_user_module(name):
- return name and not name.startswith('./')
+ return name is not None and not name.startswith('./')
@staticmethod
def _is_builtin_module(name):
--
2.26.2
- Re: [PATCH v2 11/38] qapi/common.py: Replace one-letter 'c' variable, (continued)
- Re: [PATCH v2 24/38] qapi/gen.py: Fix edge-case of _is_user_module, Markus Armbruster, 2020/09/25
- Re: [PATCH v2 24/38] qapi/gen.py: Fix edge-case of _is_user_module, Eduardo Habkost, 2020/09/25
- Re: [PATCH v2 24/38] qapi/gen.py: Fix edge-case of _is_user_module, Eduardo Habkost, 2020/09/25
- Re: [PATCH v2 24/38] qapi/gen.py: Fix edge-case of _is_user_module, Markus Armbruster, 2020/09/28
- Re: [PATCH v2 24/38] qapi/gen.py: Fix edge-case of _is_user_module, John Snow, 2020/09/25