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'
This commit is contained in:
Cole Robinson 2009-05-19 13:03:03 +00:00
parent de658ab4e4
commit 5b13f4375d
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,7 @@
Tue May 19 09:00:43 EDT 2009 Cole Robinson <crobinso@redhat.com>
* python/libvir.py: Don't overwrite legitimate python import error.
Tue May 19 12:04:22 BST 2009 Daniel P. Berrange <berrange@redhat.com>
Fix misc locking bugs identified by lock checker

View File

@ -8,8 +8,12 @@
# On cygwin, the DLL is called cygvirtmod.dll
try:
import libvirtmod
except:
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