Author: Armin Rigo <[email protected]>
Branch:
Changeset: r625:50356aa8b112
Date: 2012-07-11 12:25 +0200
http://bitbucket.org/cffi/cffi/changeset/50356aa8b112/
Log: More precise error message
diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c
--- a/c/_cffi_backend.c
+++ b/c/_cffi_backend.c
@@ -2946,8 +2946,10 @@
return &ffi_type_void;
}
- if (ct->ct_size < 0) {
- PyErr_Format(PyExc_TypeError, "ctype '%s' has incomplete type",
+ if (ct->ct_size <= 0) {
+ PyErr_Format(PyExc_TypeError,
+ ct->ct_size < 0 ? "ctype '%s' has incomplete type"
+ : "ctype '%s' has size 0",
ct->ct_name);
return NULL;
}
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit