Skip to content

Commit a69375f

Browse files
committed
Fix get_name_from_func for partialmethod in Python 3.13
Handle _partialmethod moving to __partialmethod__ in Python 3.13
1 parent 74eb9e2 commit a69375f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

elasticapm/utils/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ def get_name_from_func(func: FunctionType) -> str:
7878
return "partial({})".format(get_name_from_func(func.func))
7979
elif hasattr(func, "_partialmethod") and hasattr(func._partialmethod, "func"):
8080
return "partial({})".format(get_name_from_func(func._partialmethod.func))
81+
elif hasattr(func, "__partialmethod__") and hasattr(func.__partialmethod__, "func"):
82+
return "partial({})".format(get_name_from_func(func.__partialmethod__.func))
8183

8284
module = func.__module__
8385

0 commit comments

Comments
 (0)