diff options
author | jaseg <code@jaseg.net> | 2017-07-03 13:13:50 +0200 |
---|---|---|
committer | jaseg <code@jaseg.net> | 2017-07-03 13:13:50 +0200 |
commit | a80f638732cdcd6837b3a8818ab7822993bd42b4 (patch) | |
tree | 54b28da9f317d313a4e00848d78c35128687de0d /mpv.py | |
parent | 03492ba394acef7c15258b0b9709d077265752c1 (diff) | |
download | python-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.py | 17 |
1 files changed, 7 insertions, 10 deletions
@@ -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): |