From: Pablo Galindo Salgado Date: Wed, 10 Sep 2025 00:08:09 +0000 (+0100) Subject: gh-135953: Fix refleak in cache method (#138721) X-Git-Tag: v3.15.0a1~427 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=766e7f150ae93d637824d9b156196d98877504d3;p=thirdparty%2FPython%2Fcpython.git gh-135953: Fix refleak in cache method (#138721) --- diff --git a/Lib/profiling/sampling/stack_collector.py b/Lib/profiling/sampling/stack_collector.py index 9df8111c451d..25539640b8de 100644 --- a/Lib/profiling/sampling/stack_collector.py +++ b/Lib/profiling/sampling/stack_collector.py @@ -85,8 +85,9 @@ class FlamegraphCollector(StackTraceCollector): print(f"Flamegraph saved to: {filename}") + @staticmethod @functools.lru_cache(maxsize=None) - def _format_function_name(self, func): + def _format_function_name(func): filename, lineno, funcname = func if len(filename) > 50: