[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 24/37] qapi/gen.py: Fix edge-case of _is_user_module
From: |
John Snow |
Subject: |
[PATCH 24/37] qapi/gen.py: Fix edge-case of _is_user_module |
Date: |
Tue, 15 Sep 2020 18:40:14 -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 11472ba043..fc46813d1a 100644
--- a/scripts/qapi/gen.py
+++ b/scripts/qapi/gen.py
@@ -221,7 +221,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
- [PATCH 13/37] qapi/common.py: add notational type hints, (continued)
[PATCH 15/37] qapi/common.py: split build_params into new file, John Snow, 2020/09/15
[PATCH 24/37] qapi/gen.py: Fix edge-case of _is_user_module,
John Snow <=
[PATCH 21/37] qapi/commands.py: enable checking with mypy, John Snow, 2020/09/15
[PATCH 16/37] qapi: establish mypy type-checking baseline, John Snow, 2020/09/15
Re: [PATCH 16/37] qapi: establish mypy type-checking baseline, John Snow, 2020/09/18
Re: [PATCH 16/37] qapi: establish mypy type-checking baseline, Markus Armbruster, 2020/09/21
Re: [PATCH 16/37] qapi: establish mypy type-checking baseline, John Snow, 2020/09/21