Commits

Armin Rigo committed 5c84521

Improve the error messages

  • Participants
  • Parent commits 2de6f65

Comments (0)

Files changed (1)

pypy/module/_cffi_backend/ctypeobj.py

 
     def typeoffsetof(self, fieldname):
         space = self.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