# HG changeset patch
# User Sergey Torokhov <
torokh...@yandex.ru>
# Date 1660771688 -10800
# Thu Aug 18 00:28:08 2022 +0300
# Node ID 138005449f614fcc28806a1c6b637c8620190dcf
# Parent 81a6f0507e07620bf17ebdc150907dab213d098e
tests/mercurialapi_test.py: fix failure in Python 3.11 for inspect module
The AttributeError is due to 'getargspec' is removed from 'inspect'module
in Python 3.11.
In the "What’s New In Python 3.11" [1] is mentioned
"Removed from the inspect module:
- the getargspec function, deprecated since Python 3.0; use inspect.signature()
or inspect.getfullargspec() instead."
The replacing 'getargspec' with 'getfullargspec' fix issue.
The 'signature' function of 'inspect' implemented since Python 3.3
therefore 'getfullargspec' is prefered this place as it's
implemented since 'Pyhton 3.0'
#issue:
https://foss.heptapod.net/mercurial/tortoisehg/thg/-/issues/5826
[1]
https://docs.python.org/3.11/whatsnew/3.11.html
diff -r 81a6f0507e07 -r 138005449f61 tests/mercurialapi_test.py
--- a/tests/mercurialapi_test.py Sat Jun 25 17:53:09 2022 +0900
+++ b/tests/mercurialapi_test.py Thu Aug 18 00:28:08 2022 +0300
@@ -5,7 +5,7 @@
from tortoisehg.util import hglib, pipeui
def test_same_argspec(f, g):
- fa, ga = inspect.getargspec(f), inspect.getargspec(g)
+ fa, ga = inspect.getfullargspec(f), inspect.getfullargspec(g)
assert fa == ga, '%s != %s' % (inspect.formatargspec(*fa),
inspect.formatargspec(*ga))