supersaiyanmode / PyWebOSTV

Python API for controlling LG TVs (Web OS)
MIT License
261 stars 50 forks source link

Incorrect sequence of "Callable" imports. Python-dbg #91

Open vzarutskiy opened 1 year ago

vzarutskiy commented 1 year ago

controls.py includes imports:

try:
    # begin try for python <= 3.5
    from collections import Callable
except ImportError:
    # after try for python >= 3.10
    from typing import Callable

But python-dbg reported warning in this place:

[_showwarnmsg_impl]: /home/user/.local/lib/python3.8/site-packages/pywebostv/controls.py:3: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
  from collections import Callable

Sequence must be like:

try:
    from typing import Callable
except ImportError:
    from collections import Callable

Or you can use "sys.version_info" for python version checking.