summaryrefslogtreecommitdiffstats
path: root/libvir.py
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2009-05-19 13:03:03 +0000
committerCole Robinson <crobinso@redhat.com>2009-05-19 13:03:03 +0000
commitcbfce0d1daa2e34f553dd71f978b80a7794bf3e6 (patch)
tree9694ee4d0b2fe0ca52084ecb38a34230cca5ae76 /libvir.py
parent9e8c2f4b3557e5df4a93cd0448290be50b96d1d2 (diff)
downloadlibvirt-python-v6-cbfce0d1daa2e34f553dd71f978b80a7794bf3e6.tar.gz
libvirt-python-v6-cbfce0d1daa2e34f553dd71f978b80a7794bf3e6.tar.xz
libvirt-python-v6-cbfce0d1daa2e34f553dd71f978b80a7794bf3e6.zip
Better error reporting if 'import libvirtmod' fails
Don't squash a possibly legitimate libvirtmod error (e.g. some from clashing libvirt.so versions) with 'Cannot import cygvirtmod'
Diffstat (limited to 'libvir.py')
-rw-r--r--libvir.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/libvir.py b/libvir.py
index 8a16dd0..3cda8dc 100644
--- a/libvir.py
+++ b/libvir.py
@@ -8,8 +8,12 @@
# On cygwin, the DLL is called cygvirtmod.dll
try:
import libvirtmod
-except:
- import cygvirtmod as libvirtmod
+except ImportError, lib_e:
+ try:
+ import cygvirtmod as libvirtmod
+ except ImportError, cyg_e:
+ if str(cyg_e).count("No module named"):
+ raise lib_e
import types