diff options
author | Doug Goldstein <cardoe@cardoe.com> | 2013-12-06 16:22:39 -0600 |
---|---|---|
committer | Doug Goldstein <cardoe@cardoe.com> | 2013-12-09 08:49:56 -0600 |
commit | bf9bc814476d01231c810ef1243d91fea29e9bc4 (patch) | |
tree | dcbb7f65dfc68037f1d37ef8f4fce8e0a651f52a /libvirt-override-virStream.py | |
parent | c2da29418065371c99a11e1938ef695440361da8 (diff) | |
download | libvirt-python-bf9bc814476d01231c810ef1243d91fea29e9bc4.tar.gz |
override: Fix exception handling syntax
Python 3 no longer accepts 'except Exception, e:' as valid while Python
2.4 does not accept the new syntax 'except Exception as e:' so this uses
a fall back method that is compatible with both.
Diffstat (limited to 'libvirt-override-virStream.py')
-rw-r--r-- | libvirt-override-virStream.py | 3 |
1 files changed, 2 insertions, 1 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: |