From e507f8ef32ccfaef86d658690d8bb78484619d4c Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Tue, 25 Jul 2017 14:19:43 +0200 Subject: python wrapper: use a correct return type for bd_context_alloc() --- brill_data.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/brill_data.py b/brill_data.py index cdb5ae5..e46417c 100644 --- a/brill_data.py +++ b/brill_data.py @@ -52,7 +52,9 @@ class BrillData(object): def __init__(self, **kwargs): self._libbd = ctypes.CDLL('libbrilldata.so') - self._bdctx = ctypes.cast(self._libbd.bd_context_alloc(), ctypes.POINTER(self._BDContext)) + bdctx_alloc = self._libbd.bd_context_alloc + bdctx_alloc.restype = ctypes.POINTER(self._BDContext) + self._bdctx = self._libbd.bd_context_alloc() for arg, value in kwargs.iteritems(): try: self._bdctx.contents.__setattr__(arg, value) -- cgit v1.2.3