From 28d97417011a0acf7241739d2c2d191f68f45bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20B=C3=BCnzli?= Date: Tue, 18 Mar 2025 23:00:43 +0100 Subject: [PATCH] gtTrace checks the name of a method's first argument in order to determine whether it's 'self' (which is customarily used in object methods). It does however not check whether there are any arguments at all, causing gtTrace to fail for standalone functions without any arguments. This fix adds a check on whether there are any arguments before accessing the name of the first argument. --- PyPI/src/gtoolkit_bridge/PythonBridge/telemetry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyPI/src/gtoolkit_bridge/PythonBridge/telemetry.py b/PyPI/src/gtoolkit_bridge/PythonBridge/telemetry.py index ac4e6b3..06d6fd6 100644 --- a/PyPI/src/gtoolkit_bridge/PythonBridge/telemetry.py +++ b/PyPI/src/gtoolkit_bridge/PythonBridge/telemetry.py @@ -73,7 +73,7 @@ def wrapper_gtTrace(*args, **kwargs): funcName = func.__name__ funcArgNames = inspect.getfullargspec(func).args funcArgs = [(name, copy(value)) for name, value in zip(funcArgNames, args)] - if (funcArgNames[0] == 'self'): + if (len(funcArgNames) > 0 and funcArgNames[0] == 'self'): receiver = args[0] funcArgs = funcArgs[1:] else: