Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r75299:230d81716c11
Date: 2015-01-11 22:56 +0100
http://bitbucket.org/pypy/pypy/changeset/230d81716c11/

Log:    fix error message

diff --git a/pypy/module/_cffi_backend/func.py 
b/pypy/module/_cffi_backend/func.py
--- a/pypy/module/_cffi_backend/func.py
+++ b/pypy/module/_cffi_backend/func.py
@@ -55,7 +55,13 @@
     except OperationError, e:
         if not e.match(space, space.w_TypeError):
             raise
-        index = space.int_w(w_field_or_index)
+        try:
+            index = space.int_w(w_field_or_index)
+        except OperationError, e:
+            if not e.match(space, space.w_TypeError):
+                raise
+            raise OperationError(space.w_TypeError,
+                    space.wrap("field name or array index expected"))
         ctype, offset = w_ctype.typeoffsetof_index(index)
     else:
         ctype, offset = w_ctype.typeoffsetof_field(fieldname, following)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to