(core) Make Python tests pass in Python 3.11

Summary: Mostly just changes to tests to make them more flexible.

Test Plan: Python tests pass locally with 3.10 and 3.11. Making tests run in CI on these versions will happen in grist-core.

Reviewers: paulfitz

Reviewed By: paulfitz

Subscribers: paulfitz

Differential Revision: https://phab.getgrist.com/D3978
This commit is contained in:
Alex Hall
2023-07-28 14:25:00 +02:00
parent a77170c4bd
commit d8b2dcbb55
5 changed files with 49 additions and 32 deletions

View File

@@ -52,7 +52,10 @@ class AutocompleteContext(object):
}
for key, value in six.iteritems(self._context):
if value and callable(value):
argspec = inspect.formatargspec(*inspect.getargspec(value))
if six.PY2:
argspec = inspect.formatargspec(*inspect.getargspec(value))
else:
argspec = str(inspect.signature(value)) # pylint: disable=no-member
self._functions[key] = Completion(key, argspec, is_grist_func(value))
for key, value in self._context.copy().items():