Armin Rigo  committed 5c84521

Improve the error messages

  • Participants
  • Parent commits 2de6f65

Comments (0)

Files changed (1)

File pypy/module/_cffi_backend/

     def typeoffsetof(self, fieldname):
         space =
-        raise OperationError(space.w_TypeError,
-                             space.wrap("not a struct or union ctype"))
+        if fieldname is None:
+            msg = "expected a struct or union ctype"
+        else:
+            msg = "expected a struct or union ctype, or a pointer to one"
+        raise OperationError(space.w_TypeError, space.wrap(msg))
     def _getfields(self):
         return None