diff options
| author | Armin Rigo <arigo@tunes.org> | 2016-12-22 12:29:17 +0100 |
|---|---|---|
| committer | Armin Rigo <arigo@tunes.org> | 2016-12-22 12:29:17 +0100 |
| commit | d7b25146b02e4e33787b38dc18b5eb4b91c19fb1 (patch) | |
| tree | 42594e093d73ed5cd958a2bcbfac49daba8c421f | |
| parent | 5b4a122954c52e59ac99290f9de536ebacdccc94 (diff) | |
| download | cffi-d7b25146b02e4e33787b38dc18b5eb4b91c19fb1.tar.gz | |
More carefulness in the error messages
| -rw-r--r-- | c/_cffi_backend.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c index 2ca89be..b92bbe9 100644 --- a/c/_cffi_backend.c +++ b/c/_cffi_backend.c @@ -4758,11 +4758,17 @@ static ffi_type *fb_fill_type(struct funcbuilder_s *fb, CTypeDescrObject *ct, } return ffistruct; } - else { + else if (ct->ct_flags & CT_UNION) { PyErr_Format(PyExc_NotImplementedError, - "ctype '%s' (size %zd) not supported as %s. " + "ctype '%s' not supported as %s. " "Unions" SUPPORTED_IN_API_MODE, - ct->ct_name, ct->ct_size, place, place); + ct->ct_name, place, place); + return NULL; + } + else { + PyErr_Format(PyExc_NotImplementedError, + "ctype '%s' (size %zd) not supported as %s", + ct->ct_name, ct->ct_size, place); return NULL; } } |
