From 93b7b3cb726a56e278b428ae5064695197143c8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sat, 7 Nov 2015 00:20:24 +0100 Subject: [PATCH] utils/QubesWatch: improve error handling (minor) --- core/qubesutils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/qubesutils.py b/core/qubesutils.py index ee669d7c..0ab25e34 100644 --- a/core/qubesutils.py +++ b/core/qubesutils.py @@ -750,10 +750,10 @@ class QubesWatch(object): try: if vm.isActive(): self._register_watches(vm) - except libvirt.libvirtError: + except libvirt.libvirtError as e: # this will happen if we loose a race with another tool, # which can just remove the domain - if vmm.libvirt_conn.virConnGetLastError()[0] == libvirt.VIR_ERR_NO_DOMAIN: + if e.get_error_code() == libvirt.VIR_ERR_NO_DOMAIN: pass raise # and for dom0