Skip to content

Commit 051a00c

Browse files
pmhahnberrange
authored andcommitted
override: no type change
static typing forbids re-declaring a variable with different types. Rename the variable. Signed-off-by: Philipp Hahn <[email protected]>
1 parent abbd47f commit 051a00c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

libvirt-override.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,13 @@ def _eventInvokeHandleCallback(watch: int, fd: int, event: int, opaque: Union[Tu
179179
# future invocations match the virEventHandleCallback prototype
180180
if opaquecompat:
181181
callback = opaque
182-
opaque = opaquecompat
182+
opaque_ = opaquecompat
183183
else:
184+
assert isinstance(opaque, tuple)
184185
callback = opaque[0]
185-
opaque = opaque[1]
186+
opaque_ = opaque[1]
186187

187-
libvirtmod.virEventInvokeHandleCallback(watch, fd, event, callback, opaque)
188+
libvirtmod.virEventInvokeHandleCallback(watch, fd, event, callback, opaque_)
188189

189190

190191
#
@@ -200,12 +201,13 @@ def _eventInvokeTimeoutCallback(timer: int, opaque: Union[Tuple[_TimerCB, _T], _
200201
# future invocations match the virEventTimeoutCallback prototype
201202
if opaquecompat:
202203
callback = opaque
203-
opaque = opaquecompat
204+
opaque_ = opaquecompat
204205
else:
206+
assert isinstance(opaque, tuple)
205207
callback = opaque[0]
206-
opaque = opaque[1]
208+
opaque_ = opaque[1]
207209

208-
libvirtmod.virEventInvokeTimeoutCallback(timer, callback, opaque)
210+
libvirtmod.virEventInvokeTimeoutCallback(timer, callback, opaque_)
209211

210212

211213
def _dispatchEventHandleCallback(watch: int, fd: int, events: int, cbData: Dict[str, Any]) -> int:

0 commit comments

Comments
 (0)