diff options
author | Cole Robinson <crobinso@redhat.com> | 2009-05-19 13:03:03 +0000 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2009-05-19 13:03:03 +0000 |
commit | cbfce0d1daa2e34f553dd71f978b80a7794bf3e6 (patch) | |
tree | 9694ee4d0b2fe0ca52084ecb38a34230cca5ae76 /libvir.py | |
parent | 9e8c2f4b3557e5df4a93cd0448290be50b96d1d2 (diff) | |
download | libvirt-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.py | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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 |