Compatibility with Python 3.11
In tango-controls/cppTango!1031 (comment 1211028551) @beenje found issues with Sardana testsuite on Python 3.11.
The one I could identify from the Pool logs is saradna_logs_python3.11.zip:
MainThread WARNING 2022-12-15 15:09:40,230 ControllerManager: Failed to add controller class DummyCounterTimerController
Traceback (most recent call last):
File "/opt/conda/lib/python3.11/site-packages/sardana/pool/poolcontrollermanager.py", line 461, in addController
controller_class = ControllerClass(pool=self.get_pool(),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/sardana/pool/poolmetacontroller.py", line 307, in __init__
init_args = inspect.getargspec(klass.__init__)
^^^^^^^^^^^^^^^^^^
AttributeError: module 'inspect' has no attribute 'getargspec'
In Python 3.11 we get:
Python 3.11.0 | packaged by conda-forge | (main, Oct 25 2022, 06:24:40) [GCC 10.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import inspect
>>> def foo(bar):
... pass
...
>>> inspect.getargspec(foo)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'inspect' has no attribute 'getargspec'. Did you mean: 'getargs'?
In Python 3.10 we can see this was deprecated:
Python 3.10.6 | packaged by conda-forge | (main, Aug 22 2022, 20:35:26) [GCC 10.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import inspect
>>> def foo(bar):
... pass
...
>>> inspect.getargspec(foo)
<stdin>:1: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
ArgSpec(args=['bar'], varargs=None, keywords=None, defaults=None)