mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-11 05:17:59 +03:00
py3: store exception variables for use outside except
In python3 exceptions aren't defined outside the except block. Leading to 'UnboundLocalError: local variable 'e' referenced before assignment' errors. To work around this, store the local variable into one that will have a longer life.
This commit is contained in:
parent
ca3c3a5869
commit
60968fa259
@ -1439,7 +1439,8 @@ class vmmConnection(vmmGObject):
|
|||||||
self._tick(*args, **kwargs)
|
self._tick(*args, **kwargs)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
raise
|
raise
|
||||||
except Exception as e:
|
except Exception as err:
|
||||||
|
e = err
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if e is None:
|
if e is None:
|
||||||
|
Loading…
Reference in New Issue
Block a user