Skip to content

Commit

Permalink
qapi/introspect.py: set _gen_tree's default ifcond argument to ()
Browse files Browse the repository at this point in the history
We don't need to create an empty, mutable list to pass to _gen_tree;
since it is now typed as a Sequence, we can use the empty tuple as a
default and omit the argument.

Signed-off-by: John Snow <jsnow@redhat.com>
Message-Id: <20210216021809.134886-19-jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
  • Loading branch information
jnsnow authored and Markus Armbruster committed Feb 18, 2021
1 parent cea53c3 commit 9b77d94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/qapi/introspect.py
Expand Up @@ -254,7 +254,7 @@ def _gen_features(features: Sequence[QAPISchemaFeature]
return [Annotated(f.name, f.ifcond) for f in features]

def _gen_tree(self, name: str, mtype: str, obj: Dict[str, object],
ifcond: Sequence[str],
ifcond: Sequence[str] = (),
features: Sequence[QAPISchemaFeature] = ()) -> None:
"""
Build and append a SchemaInfo object to self._trees.
Expand Down Expand Up @@ -302,7 +302,7 @@ def _gen_variant(self, variant: QAPISchemaVariant

def visit_builtin_type(self, name: str, info: Optional[QAPISourceInfo],
json_type: str) -> None:
self._gen_tree(name, 'builtin', {'json-type': json_type}, [])
self._gen_tree(name, 'builtin', {'json-type': json_type})

def visit_enum_type(self, name: str, info: Optional[QAPISourceInfo],
ifcond: Sequence[str],
Expand Down

0 comments on commit 9b77d94

Please sign in to comment.