mk-fg / python-pulse-control

Python high-level interface and ctypes-based bindings for PulseAudio (libpulse)
https://pypi.org/project/pulsectl/
MIT License
170 stars 36 forks source link

DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec() #62

Closed agners closed 3 years ago

agners commented 3 years ago

When pulsectl is imported in a pytest i see the following deprecation warnings:

../../usr/local/lib/python3.9/site-packages/pulsectl/pulsectl.py:611: 20 warnings
  /usr/local/lib/python3.9/site-packages/pulsectl/pulsectl.py:611: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
    func_args = list(inspect.getargspec(func or (lambda: None)))

../../usr/local/lib/python3.9/site-packages/pulsectl/pulsectl.py:615: 20 warnings
  /usr/local/lib/python3.9/site-packages/pulsectl/pulsectl.py:615: DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly
    _wrapper.__doc__ = 'Signature: func' + inspect.formatargspec(*func_args)

-- Docs: https://docs.pytest.org/en/stable/warnings.html
mk-fg commented 3 years ago

Should be fixed by 6661f2c in 21.5.18, and signatures of wrapper funcs hopefully look a bit nicer in py3 too due to __signature__ overrides. Thanks for reporting.