Commit f3a80118 authored by scoder's avatar scoder

Merge pull request #479 from llllllllll/import-size-mismatch

update error message in __Pyx_ImportType when basicsize doesn't match
parents dace1e6c fc834bb8
...@@ -394,14 +394,14 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class ...@@ -394,14 +394,14 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
#endif #endif
if (!strict && (size_t)basicsize > size) { if (!strict && (size_t)basicsize > size) {
PyOS_snprintf(warning, sizeof(warning), PyOS_snprintf(warning, sizeof(warning),
"%s.%s size changed, may indicate binary incompatibility", "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
module_name, class_name); module_name, class_name, basicsize, size);
if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
} }
else if ((size_t)basicsize != size) { else if ((size_t)basicsize != size) {
PyErr_Format(PyExc_ValueError, PyErr_Format(PyExc_ValueError,
"%.200s.%.200s has the wrong size, try recompiling", "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
module_name, class_name); module_name, class_name, basicsize, size);
goto bad; goto bad;
} }
return (PyTypeObject *)result; return (PyTypeObject *)result;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment