Fix _libimport when libcv is not available.

This commit is contained in:
Stefan van der Walt
2009-10-23 11:18:10 +02:00
parent d277058ff9
commit d753726a83
+7 -2
View File
@@ -25,9 +25,14 @@ def _import_opencv_lib(which="cv"):
if sys.platform.startswith("darwin"):
shared_lib = _tryload_macosx(which)
elif sys.platform.startswith("linux"):
shared_lib = ctypes.CDLL('lib' + which + '.so')
libname = 'lib%s.so' % which
else:
shared_lib = ctypes.CDLL(which + '.dll')
libname = 'lib%s.dll' % which
try:
shared_lib = ctypes.CDLL(libname)
except OSError:
shared_lib = None
if shared_lib is None:
warnings.warn(RuntimeWarning(