summaryrefslogtreecommitdiff
path: root/mpv.py
diff options
context:
space:
mode:
authorjaseg <code@jaseg.net>2017-07-03 13:13:50 +0200
committerjaseg <code@jaseg.net>2017-07-03 13:13:50 +0200
commita80f638732cdcd6837b3a8818ab7822993bd42b4 (patch)
tree54b28da9f317d313a4e00848d78c35128687de0d /mpv.py
parent03492ba394acef7c15258b0b9709d077265752c1 (diff)
downloadpython-mpv-a80f638732cdcd6837b3a8818ab7822993bd42b4.tar.gz
python-mpv-a80f638732cdcd6837b3a8818ab7822993bd42b4.tar.bz2
python-mpv-a80f638732cdcd6837b3a8818ab7822993bd42b4.zip
Make compatible with libmpv 0.22.0
Diffstat (limited to 'mpv.py')
-rw-r--r--mpv.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/mpv.py b/mpv.py
index 723c519..7a7c1a2 100644
--- a/mpv.py
+++ b/mpv.py
@@ -971,17 +971,14 @@ class MPV(object):
def _set_property(self, name, value, proptype=str):
ename = name.encode('utf-8')
- try:
- if proptype is MpvFormat.NODE:
- if isinstance(value, (list, set, dict)):
- _1, _2, _3, pointer = _make_node_str_list(value)
- _mpv_set_property(self.handle, ename, MpvFormat.NODE, pointer)
- else:
- _mpv_set_property_string(self.handle, ename, _mpv_coax_proptype(value, str))
+ if proptype is MpvFormat.NODE:
+ if isinstance(value, (list, set, dict)):
+ _1, _2, _3, pointer = _make_node_str_list(value)
+ _mpv_set_property(self.handle, ename, MpvFormat.NODE, pointer)
else:
- _mpv_set_property_string(self.handle, ename, _mpv_coax_proptype(value, proptype))
- except TypeError as e:
- raise TypeError("Error setting MPV {} property {}".format(proptype, name)) from e
+ _mpv_set_property_string(self.handle, ename, _mpv_coax_proptype(value, str))
+ else:
+ _mpv_set_property_string(self.handle, ename, _mpv_coax_proptype(value, proptype))
# Dict-like option access
def __getitem__(self, name, file_local=False):