Author: Armin Rigo <ar...@tunes.org>
Branch: 
Changeset: r2580:6e962065ec24
Date: 2016-01-14 10:28 +0100
http://bitbucket.org/cffi/cffi/changeset/6e962065ec24/

Log:    Expand the error message

diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c
--- a/c/_cffi_backend.c
+++ b/c/_cffi_backend.c
@@ -2,6 +2,8 @@
 #include <Python.h>
 #include "structmember.h"
 
+#define CFFI_VERSION  "1.4.2"
+
 #ifdef MS_WIN32
 #include <windows.h>
 #include "misc_win32.h"
@@ -6500,7 +6502,7 @@
     if (v == NULL || PyModule_AddObject(m, "_C_API", v) < 0)
         INITERROR;
 
-    v = PyText_FromString("1.4.2");
+    v = PyText_FromString(CFFI_VERSION);
     if (v == NULL || PyModule_AddObject(m, "__version__", v) < 0)
         INITERROR;
 
diff --git a/c/cffi1_module.c b/c/cffi1_module.c
--- a/c/cffi1_module.c
+++ b/c/cffi1_module.c
@@ -169,8 +169,10 @@
     if (version < CFFI_VERSION_MIN || version > CFFI_VERSION_MAX) {
         if (!PyErr_Occurred())
             PyErr_Format(PyExc_ImportError,
-                         "cffi extension module '%s' has unknown version %p",
-                         module_name, (void *)version);
+                "cffi extension module '%s' uses an unknown version tag %p. "
+                "This module might need a more recent version of cffi "
+                "than the one currently installed, which is %s",
+                module_name, (void *)version, CFFI_VERSION);
         return NULL;
     }
 
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to