summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-04-15 12:03:36 +0000
committerDavid Robillard <d@drobilla.net>2015-04-15 12:03:36 +0000
commite395dd6a115cd5ba9e98321f3ca4b262c4d0e52b (patch)
treef10850d1df754d6e13cfa3ba912699db90315aa6
parent842e254ee7446fe117fcfbd65ad23fc8b977c2ca (diff)
downloadlilv-e395dd6a115cd5ba9e98321f3ca4b262c4d0e52b.tar.gz
lilv-e395dd6a115cd5ba9e98321f3ca4b262c4d0e52b.tar.bz2
lilv-e395dd6a115cd5ba9e98321f3ca4b262c4d0e52b.zip
Fix bindings for Python 3.
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@5675 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--NEWS1
-rw-r--r--bindings/lilv.i4
-rw-r--r--bindings/numpy.i4
3 files changed, 6 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 2d507b3..69628d3 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ lilv (0.21.3) unstable;
* Add lilv_state_delete() for deleting user saved presets
* Fix lilv_world_ask() to work with wildcards
* Fix creation of duplicate manifest entries when saving state
+ * Fix bindings for Python 3
* Load discovered owl ontologies as specifications
* Expose lilv_world_load_specifications() and
lilv_world_load_plugin_classes()
diff --git a/bindings/lilv.i b/bindings/lilv.i
index c4c33fb..8bbdd3f 100644
--- a/bindings/lilv.i
+++ b/bindings/lilv.i
@@ -32,8 +32,8 @@ namespace Lilv {
def __init__(self, plugins):
self.plugins = plugins
self.iter = plugins.begin()
-
- def next(self):
+
+ def __next__(self):
if self.plugins.is_end(self.iter):
raise StopIteration
plugin = self.plugins.get(self.iter)
diff --git a/bindings/numpy.i b/bindings/numpy.i
index 6f71f58..d695b36 100644
--- a/bindings/numpy.i
+++ b/bindings/numpy.i
@@ -107,9 +107,11 @@
if (PyDict_Check( py_obj)) return "dict" ;
if (PyList_Check( py_obj)) return "list" ;
if (PyTuple_Check( py_obj)) return "tuple" ;
- if (PyFile_Check( py_obj)) return "file" ;
if (PyModule_Check( py_obj)) return "module" ;
+%#if PY_MAJOR_VERSION < 3
+ if (PyFile_Check( py_obj)) return "file" ;
if (PyInstance_Check(py_obj)) return "instance" ;
+%#endif
return "unkown type";
}