Skip to content

Commit

Permalink
qapi: Simplify code a bit after previous commits
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20230316071325.492471-7-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[Commit message corrected]
  • Loading branch information
Markus Armbruster committed Apr 24, 2023
1 parent 2a0c975 commit 7c40751
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions scripts/qapi/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,21 +335,13 @@ def normalize_members(members: object) -> None:

def check_type_name(value: Optional[object],
info: QAPISourceInfo, source: str) -> None:
if value is None:
return

if isinstance(value, str):
return

raise QAPISemError(info, "%s should be a type name" % source)
if value is not None and not isinstance(value, str):
raise QAPISemError(info, "%s should be a type name" % source)


def check_type_name_or_array(value: Optional[object],
info: QAPISourceInfo, source: str) -> None:
if value is None:
return

if isinstance(value, str):
if value is None or isinstance(value, str):
return

if isinstance(value, list):
Expand Down

0 comments on commit 7c40751

Please sign in to comment.