Author: Armin Rigo <ar...@tunes.org>
Branch: 
Changeset: r2837:2214fb22286b
Date: 2016-12-22 12:29 +0100
http://bitbucket.org/cffi/cffi/changeset/2214fb22286b/

Log:    More carefulness in the error messages

diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c
--- a/c/_cffi_backend.c
+++ b/c/_cffi_backend.c
@@ -4758,11 +4758,17 @@
         }
         return ffistruct;
     }
+    else if (ct->ct_flags & CT_UNION) {
+        PyErr_Format(PyExc_NotImplementedError,
+                     "ctype '%s' not supported as %s.  "
+                     "Unions" SUPPORTED_IN_API_MODE,
+                     ct->ct_name, place, place);
+        return NULL;
+    }
     else {
         PyErr_Format(PyExc_NotImplementedError,
-                     "ctype '%s' (size %zd) not supported as %s.  "
-                     "Unions" SUPPORTED_IN_API_MODE,
-                     ct->ct_name, ct->ct_size, place, place);
+                     "ctype '%s' (size %zd) not supported as %s",
+                     ct->ct_name, ct->ct_size, place);
         return NULL;
     }
 }
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to