diff options
author | David Robillard <d@drobilla.net> | 2019-10-23 00:00:01 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-10-23 00:00:01 +0200 |
commit | ce097012c2ea8ff09db48621af90eeca09579f16 (patch) | |
tree | b9ac0e0b51e1e4d42034ece0df0cbdab53724d0e /bindings/python | |
parent | 921cbd4be494dffa8e59902ac4b576b85e712ea9 (diff) | |
download | lilv-ce097012c2ea8ff09db48621af90eeca09579f16.tar.gz lilv-ce097012c2ea8ff09db48621af90eeca09579f16.tar.bz2 lilv-ce097012c2ea8ff09db48621af90eeca09579f16.zip |
Fix Python bindings on Windows
Diffstat (limited to 'bindings/python')
-rw-r--r-- | bindings/python/lilv.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bindings/python/lilv.py b/bindings/python/lilv.py index e4e9f6a..70fb79f 100644 --- a/bindings/python/lilv.py +++ b/bindings/python/lilv.py @@ -8,6 +8,8 @@ __maintainer__ = "David Robillard" __email__ = "d@drobilla.net" __status__ = "Production" +import sys + from ctypes import Structure, CDLL, POINTER, CFUNCTYPE from ctypes import c_bool, c_double, c_float, c_int, c_size_t, c_uint, c_uint32 from ctypes import c_char, c_char_p, c_void_p @@ -22,10 +24,10 @@ class _LilvLib: """Object that represents the liblilv C library""" def __init__(self): - import sys - if sys.platform == "darwin": self.lib = CDLL("liblilv-0.dylib") + elif sys.platform == "win32": + self.lib = CDLL("lilv-0.dll") else: self.lib = CDLL("liblilv-0.so") @@ -807,7 +809,8 @@ class Node(Structure): Returns None if value is not a file URI.""" c_str = c.node_get_path(self.node, hostname) string = cast(c_str, c_char_p).value.decode("utf-8") - c.free(c_str) + if sys.platform != 'win32': # TODO: Memory comes from libserd + c.free(c_str) return string def is_float(self): |