aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2017-07-25 14:19:43 +0200
committerAnton Khirnov <anton@khirnov.net>2017-07-25 14:19:43 +0200
commite507f8ef32ccfaef86d658690d8bb78484619d4c (patch)
treec2f9fa44ddda819813ff45404441af5b4b78bb69
parentc8f4ed68633ed005593491b85442770ee9eb4574 (diff)
python wrapper: use a correct return type for bd_context_alloc()
-rw-r--r--brill_data.py4
1 files changed, 3 insertions, 1 deletions
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)