mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-08-15 01:49:26 +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:
@ -1689,10 +1689,9 @@ def buildWrappers(module: str) -> None:
|
|||||||
#
|
#
|
||||||
# Generate enum constants
|
# Generate enum constants
|
||||||
#
|
#
|
||||||
def enumsSortKey(data):
|
def enumsSortKey(data: Tuple[str, EnumValue]) -> Tuple[Union[int, float], str]:
|
||||||
value = data[1]
|
|
||||||
try:
|
try:
|
||||||
value = int(value)
|
value = int(data[1]) # type: Union[int, float]
|
||||||
except ValueError:
|
except ValueError:
|
||||||
value = float('inf')
|
value = float('inf')
|
||||||
return value, data[0]
|
return value, data[0]
|
||||||
|
Reference in New Issue
Block a user