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:
@ -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]
|
||||
|
Reference in New Issue
Block a user