More detailed proc proxy name (#5417)

When cls.f is partial it's better to show full specification.

## For community
⬇️ **Please click the 👍 reaction instead of leaving a `+1` or 👍
comment**

---------

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Andy Kipp 2024-05-15 14:10:53 +02:00 committed by GitHub
parent e7f2489486
commit 948510e40a
Failed to generate hash of commit

View file

@ -8,7 +8,6 @@ licensed to the Python Software foundation under a Contributor Agreement.
"""
import collections.abc as cabc
import functools
import io
import os
import signal
@ -285,16 +284,11 @@ def parse_proxy_return(r, stdout, stderr):
def get_proc_proxy_name(cls):
func_name = cls.f
if type(cls.f) is functools.partial:
func_name = getattr(
cls.f.args[0], "__name__", getattr(cls.f, "__name__", cls.f)
)
return repr(
{
"cls": cls.__class__.__name__,
"name": getattr(cls, "name", None),
"func": func_name,
"func": cls.f,
"alias": cls.env.get("__ALIAS_NAME", None),
"pid": cls.pid,
}