Author: mattip <[email protected]>
Branch: 
Changeset: r71538:e4355950858a
Date: 2014-05-16 12:12 +0300
http://bitbucket.org/pypy/pypy/changeset/e4355950858a/

Log:    convert VerificationError to ImportError

diff --git a/lib_pypy/gdbm.py b/lib_pypy/gdbm.py
--- a/lib_pypy/gdbm.py
+++ b/lib_pypy/gdbm.py
@@ -36,9 +36,15 @@
 void free(void*);
 ''')
 
-lib = ffi.verify('''
-#include "gdbm.h"
-''', libraries=['gdbm'])
+try:
+    lib = ffi.verify('''
+    #include "gdbm.h"
+    ''', libraries=['gdbm'])
+except cffi.VerificationError as e:
+    # distutils does not preserve the actual message,
+    # but the verification is simple enough that the
+    # failure must be due to missing gdbm dev libs
+    raise ImportError('%s: %s' %(e.__class__.__name__, e))
 
 class error(Exception):
     pass
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to