Skip to content

Commit 8b3ebbf

Browse files
committed
getargspec is deprecated in python3.11
1 parent ed4171d commit 8b3ebbf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

webapp/graphite/functions/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ def PieFunction(name):
9696

9797

9898
def functionInfo(name, func):
99-
argspec = inspect.getargspec(func)
100-
argformat = inspect.formatargspec(argspec[0][1:], argspec[1], argspec[2], argspec[3])
99+
sig = inspect.signature(func)
100+
argspec = ', '.join(list(map(str, sig.parameters.values()))[1:])
101101
return {
102102
'name': name,
103-
'function': name + argformat,
103+
'function': f'{name}({argspec})',
104104
'description': inspect.getdoc(func),
105105
'module': inspect.getmodule(func).__name__,
106106
'group': getattr(func, 'group', 'Ungrouped'),

0 commit comments

Comments
 (0)