Skip to contentSkip to conversation

qapi/parser: Drop two bad type hints for now

PATCH In review Markus Armbruster 3 participants 3 messages May 17, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qapi/parser: Drop two bad type hints for now

Two type hints fail centos-stream-8-x86_64 CI. They are actually broken. Changing them to Optional[re.Match[str]] fixes them locally for me, but then CI fails differently. Drop them for now.

Fixes 3e32dca3f0d1 (qapi: Rewrite parsing of doc comment section symbols and tags)
---
 scripts/qapi/parser.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/qapi/parser.py +2 -2
index 4923a59d60..1ff334e6a8 100644
@@ -563,11 +563,11 @@ def end_comment(self) -> None:
         self._switch_section(QAPIDoc.NullSection(self._parser))
 
     @staticmethod
-    def _match_at_name_colon(string: str) -> re.Match:
+    def _match_at_name_colon(string: str):
         return re.match(r'@([^:]*): *', string)
 
     @staticmethod
-    def _match_section_tag(string: str) -> re.Match:
+    def _match_section_tag(string: str):
         return re.match(r'(Returns|Since|Notes?|Examples?|TODO): *', string)
 
     def _append_body_line(self, line: str) -> None:
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Markus Armbruster

Two type hints fail centos-stream-8-x86_64 CI. They are actually broken. Changing them to Optional[re.Match[str]] fixes them locally for me, but then CI fails differently. Drop them for now.

Fixes 3e32dca3f0d1 (qapi: Rewrite parsing of doc comment section symbols and tags)
---
  scripts/qapi/parser.py | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

r~

Tested-by on v1 1/1
#2 lore raw
In reply to Markus Armbruster
Quoted 6 lines · On Wed, 17 May 2023 08:16:00 +0200 Markus Armbruster <[email protected]> wrote:

Two type hints fail centos-stream-8-x86_64 CI. They are actually broken. Changing them to Optional[re.Match[str]] fixes them locally for me, but then CI fails differently. Drop them for now.

Fixes 3e32dca3f0d1 (qapi: Rewrite parsing of doc comment section symbols and tags)

Fixes build failure for me on RHEL8

Quoted 22 lines
---
 scripts/qapi/parser.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/qapi/parser.py +2 -2
index 4923a59d60..1ff334e6a8 100644
@@ -563,11 +563,11 @@ def end_comment(self) -> None:
         self._switch_section(QAPIDoc.NullSection(self._parser))
 
     @staticmethod
-    def _match_at_name_colon(string: str) -> re.Match:
+    def _match_at_name_colon(string: str):
         return re.match(r'@([^:]*): *', string)
 
     @staticmethod
-    def _match_section_tag(string: str) -> re.Match:
+    def _match_section_tag(string: str):
         return re.match(r'(Returns|Since|Notes?|Examples?|TODO): *', string)
 
     def _append_body_line(self, line: str) -> None: