tino / pyFirmata

Python interface for the Firmata (http://firmata.org/) protocol. It is compliant with Firmata 2.1. Any help with updating to 2.2 is welcome. The Capability Query is implemented, but the Pin State Query feature not yet.
MIT License
575 stars 193 forks source link

pyfirmata.py: DeprecationWarning #84

Open drumjoss opened 5 years ago

drumjoss commented 5 years ago

Hi there! With Python 3.6 I get this warning: pyfirmata.py:185: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec() len_args = len(inspect.getargspec(func)[0])

I installed last week with pip.

wovano commented 1 year ago

In Python 3.11 the getargspec() function has finally been removed and the pyFirmata library now gives an error:

AttributeError: module 'inspect' has no attribute 'getargspec'. Did you mean: 'getargs'?
kiki-jpg commented 1 year ago

could this be a solution ?

len_args = len(inspect.getargspec(func)[0])

sig = inspect.signature(func) params = sig.parameters len_args = len(params)

cyberexpertamit commented 1 year ago

Replace len_args = len(inspect.getargspec(func)[0]) with len_args = len(inspect.getfullargspec(func)[0]

gnthibault commented 1 year ago

I confirm from python 3.11 onwards, pyFirmata cannot be used as is.