diff options
Diffstat (limited to 'cffi/backend_ctypes.py')
-rw-r--r-- | cffi/backend_ctypes.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cffi/backend_ctypes.py b/cffi/backend_ctypes.py index e900247..ac5a02e 100644 --- a/cffi/backend_ctypes.py +++ b/cffi/backend_ctypes.py @@ -904,6 +904,8 @@ class CTypesBackend(object): return BType._offsetof(fieldname) def newp(self, BType, source): + if not issubclass(BType, CTypesData): + raise TypeError return BType._newp(source) def cast(self, BType, source): |