diff options
author | David Robillard <d@drobilla.net> | 2020-02-23 19:46:24 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-02-23 19:46:24 +0100 |
commit | 499a8f5f75e68befc87b23082292637aad0fcbe5 (patch) | |
tree | 3f8da58feeca7ef6a1309a74a343e53697bd6599 /bindings | |
parent | db0376206ca92c402f0d4f8d20c96307c41a7d02 (diff) | |
download | lilv-499a8f5f75e68befc87b23082292637aad0fcbe5.tar.gz lilv-499a8f5f75e68befc87b23082292637aad0fcbe5.tar.bz2 lilv-499a8f5f75e68befc87b23082292637aad0fcbe5.zip |
Fix namespace add operator with Python 2
In Python 2, a __coerce__ attribute of the Namespace is requested in this case,
which ends up producing an error. Work around this by defining a __coerce__
method that does nothing so __getattr__ is not called for it.
Diffstat (limited to 'bindings')
-rw-r--r-- | bindings/python/lilv.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bindings/python/lilv.py b/bindings/python/lilv.py index ffea115..45b8e05 100644 --- a/bindings/python/lilv.py +++ b/bindings/python/lilv.py @@ -1152,6 +1152,9 @@ class Namespace: def __str__(self): return self.prefix + def __coerce__(self, ignored): + return None + def __getattr__(self, suffix): return self.world.new_uri(self.prefix + suffix) |