summaryrefslogtreecommitdiff
path: root/cffi/backend_ctypes.py
diff options
context:
space:
mode:
Diffstat (limited to 'cffi/backend_ctypes.py')
-rw-r--r--cffi/backend_ctypes.py2
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):