summaryrefslogtreecommitdiff
path: root/libvirt-override.py
diff options
context:
space:
mode:
authorPhilipp Hahn <hahn@univention.de>2018-11-21 09:26:08 +0100
committerDaniel Berrange <berrange@redhat.com>2020-08-18 09:48:25 +0000
commit051a00c212b8191ba44f97339b30af3f8ff54f59 (patch)
treed40f98e487e8b152fd1fd0a483384f44420880bb /libvirt-override.py
parentabbd47f4ea1736a2d9eaf50b157cdfcd69dfffb9 (diff)
downloadlibvirt-python-051a00c212b8191ba44f97339b30af3f8ff54f59.tar.gz
override: no type change
static typing forbids re-declaring a variable with different types. Rename the variable. Signed-off-by: Philipp Hahn <hahn@univention.de>
Diffstat (limited to 'libvirt-override.py')
-rw-r--r--libvirt-override.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/libvirt-override.py b/libvirt-override.py
index e342884..a4e0444 100644
--- a/libvirt-override.py
+++ b/libvirt-override.py
@@ -179,12 +179,13 @@ def _eventInvokeHandleCallback(watch: int, fd: int, event: int, opaque: Union[Tu
# future invocations match the virEventHandleCallback prototype
if opaquecompat:
callback = opaque
- opaque = opaquecompat
+ opaque_ = opaquecompat
else:
+ assert isinstance(opaque, tuple)
callback = opaque[0]
- opaque = opaque[1]
+ opaque_ = opaque[1]
- libvirtmod.virEventInvokeHandleCallback(watch, fd, event, callback, opaque)
+ libvirtmod.virEventInvokeHandleCallback(watch, fd, event, callback, opaque_)
#
@@ -200,12 +201,13 @@ def _eventInvokeTimeoutCallback(timer: int, opaque: Union[Tuple[_TimerCB, _T], _
# future invocations match the virEventTimeoutCallback prototype
if opaquecompat:
callback = opaque
- opaque = opaquecompat
+ opaque_ = opaquecompat
else:
+ assert isinstance(opaque, tuple)
callback = opaque[0]
- opaque = opaque[1]
+ opaque_ = opaque[1]
- libvirtmod.virEventInvokeTimeoutCallback(timer, callback, opaque)
+ libvirtmod.virEventInvokeTimeoutCallback(timer, callback, opaque_)
def _dispatchEventHandleCallback(watch: int, fd: int, events: int, cbData: Dict[str, Any]) -> int: