jaseg / python-mpv

Python interface to the awesome mpv media player
https://git.jaseg.de/python-mpv.git
Other
532 stars 67 forks source link

Error for known-incompatible libmpv (closes #223) #224

Closed SnoopJ closed 2 years ago

SnoopJ commented 2 years ago

This PR adds an explicit error if the user's libmpv is known to be incompatible with python-mpv. With these changes, an incompatibility is reported as:

$ python3 -c "import mpv"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/snoopjedi/repos/python-mpv/mpv.py", line 543, in <module>
    raise RuntimeError(f"python-mpv requires libmpv with an API version of 1.108 or higher (libmpv >= 0.33), but you have an older version ({ver}).")
RuntimeError: python-mpv requires libmpv with an API version of 1.108 or higher (libmpv >= 0.33), but you have an older version (1.107).

Instead of the more obscure error about missing symbols (see #223)

jaseg commented 2 years ago

Thank you for the PR, looks good to me! I'm pushing this out in the next minor release.