diff options
-rw-r--r-- | libvirt-override-virStream.py | 3 | ||||
-rw-r--r-- | libvirt-override.py | 8 |
2 files changed, 8 insertions, 3 deletions
diff --git a/libvirt-override-virStream.py b/libvirt-override-virStream.py index 53000da..189d062 100644 --- a/libvirt-override-virStream.py +++ b/libvirt-override-virStream.py @@ -50,7 +50,8 @@ ret = handler(self, got, opaque) if type(ret) is int and ret < 0: raise RuntimeError("recvAll handler returned %d" % ret) - except Exception, e: + except Exception: + e = sys.exc_info()[1] try: self.abort() except: diff --git a/libvirt-override.py b/libvirt-override.py index 87996f8..63f8ecb 100644 --- a/libvirt-override.py +++ b/libvirt-override.py @@ -3,12 +3,16 @@ # # On cygwin, the DLL is called cygvirtmod.dll +import sys + try: import libvirtmod -except ImportError, lib_e: +except ImportError: + lib_e = sys.exc_info()[1] try: import cygvirtmod as libvirtmod - except ImportError, cyg_e: + except ImportError: + cyg_e = sys.exc_info()[1] if str(cyg_e).count("No module named"): raise lib_e |