mirror of
https://github.com/qemu/qemu.git
synced 2024-12-03 08:43:38 +08:00
qapi: Use re.fullmatch() where appropriate
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20210831123809.1107782-10-armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
parent
d0830ee443
commit
555dd1aaa6
@ -275,7 +275,7 @@ def check_if(expr: _JSONObject, info: QAPISourceInfo, source: str) -> None:
|
||||
|
||||
def _check_if(cond: Union[str, object]) -> None:
|
||||
if isinstance(cond, str):
|
||||
if not re.match(r'^[A-Z][A-Z0-9_]*$', cond):
|
||||
if not re.fullmatch(r'[A-Z][A-Z0-9_]*', cond):
|
||||
raise QAPISemError(
|
||||
info,
|
||||
"'if' condition '%s' of %s is not a valid identifier"
|
||||
|
Loading…
Reference in New Issue
Block a user