From e478a0091822bdeb1cebaa510b0a8f6c0c2cbf28 Mon Sep 17 00:00:00 2001 From: Alexandre Rossi Date: Sat, 16 Dec 2023 18:13:31 +0100 Subject: [PATCH] getargspec is deprecated in python3.11 --- webapp/graphite/functions/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webapp/graphite/functions/__init__.py b/webapp/graphite/functions/__init__.py index f98daf7c5..3e0f3e05a 100644 --- a/webapp/graphite/functions/__init__.py +++ b/webapp/graphite/functions/__init__.py @@ -96,11 +96,11 @@ def PieFunction(name): def functionInfo(name, func): - argspec = inspect.getargspec(func) - argformat = inspect.formatargspec(argspec[0][1:], argspec[1], argspec[2], argspec[3]) + sig = inspect.signature(func) + argspec = ', '.join(list(map(str, sig.parameters.values()))[1:]) return { 'name': name, - 'function': name + argformat, + 'function': f'{name}({argspec})', 'description': inspect.getdoc(func), 'module': inspect.getmodule(func).__name__, 'group': getattr(func, 'group', 'Ungrouped'),