1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-08-02 04:21:59 +03:00

generator: Work around type change

a variable should not change its type.

Signed-off-by: Philipp Hahn <hahn@univention.de>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Philipp Hahn
2020-04-26 20:13:22 +02:00
committed by Jano Tomko
parent d30d872251
commit 22bfd4bcab

View File

@ -1689,10 +1689,9 @@ def buildWrappers(module: str) -> None:
#
# Generate enum constants
#
def enumsSortKey(data):
value = data[1]
def enumsSortKey(data: Tuple[str, EnumValue]) -> Tuple[Union[int, float], str]:
try:
value = int(value)
value = int(data[1]) # type: Union[int, float]
except ValueError:
value = float('inf')
return value, data[0]