Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r779:64b9281744eb
Date: 2012-08-04 18:06 +0200
http://bitbucket.org/cffi/cffi/changeset/64b9281744eb/

Log:    verify() doesn't fully work with the ctypes backend. Complain
        clearly in this situation.

diff --git a/cffi/backend_ctypes.py b/cffi/backend_ctypes.py
--- a/cffi/backend_ctypes.py
+++ b/cffi/backend_ctypes.py
@@ -656,7 +656,12 @@
     def new_union_type(self, name):
         return self._new_struct_or_union('union', name, ctypes.Union)
 
-    def complete_struct_or_union(self, CTypesStructOrUnion, fields, tp):
+    def complete_struct_or_union(self, CTypesStructOrUnion, fields, tp,
+                                 totalsize=-1, totalalignment=-1):
+        if totalsize >= 0 or totalalignment >= 0:
+            raise NotImplementedError("the ctypes backend of CFFI does not 
support "
+                                      "structures completed by verify(); 
please "
+                                      "compile and install the _cffi_backend 
module.")
         struct_or_union = CTypesStructOrUnion._ctype
         fnames = [fname for (fname, BField, bitsize) in fields]
         btypes = [BField for (fname, BField, bitsize) in fields]
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to