summaryrefslogtreecommitdiff
path: root/LICENSE
diff options
context:
space:
mode:
authorFrechdachs <Frechdachs@users.noreply.github.com>2016-02-09 22:53:52 +0100
committerFrechdachs <Frechdachs@users.noreply.github.com>2016-02-09 22:53:52 +0100
commitec91bf3e57c19913cc93ac25587e4c44a74b588e (patch)
treeabe657510817d3b9740fa478beac8bcc4f8cc7f9 /LICENSE
parent694a2c2c622b9772fadca8fd082f97419819f54c (diff)
downloadpython-mpv-ec91bf3e57c19913cc93ac25587e4c44a74b588e.tar.gz
python-mpv-ec91bf3e57c19913cc93ac25587e4c44a74b588e.tar.bz2
python-mpv-ec91bf3e57c19913cc93ac25587e4c44a74b588e.zip
Fix unobserve_property
There were three problems: 1. MPV.unobserve_property called _mpv_observe_property instead of _mpv_unobserve_property. 2. _mpv_unobserve_property returns the number of properties that were assigned to the handler that is being removed. Because the return value is not 0 in such a case, ErrorCode.raise_for_ec tries to raise an error. To fix that, I changed the ErrorCode.raise_for_ec functon not to raise an error if ec is larger than 0. (If there is a positive return value, there should not have been an error anyway, if I'm not mistaken.) 3. Calling MPV.unobserve_property for a handle that is not currently been used, should not result in a KeyError being raised. An alternative to 2. would be to add a restype to the _handle_func of 'mpv_unobserve_property' and returning that value in MPV.unobserve_property. (That way, raise_for_ec is never called.) But I don't think this value is useful in any way. Even the built in lua interface does not return that value.
Diffstat (limited to 'LICENSE')
0 files changed, 0 insertions, 0 deletions