https://github.com/python/cpython/commit/766e7f150ae93d637824d9b156196d98877504d3
commit: 766e7f150ae93d637824d9b156196d98877504d3
branch: main
author: Pablo Galindo Salgado <[email protected]>
committer: pablogsal <[email protected]>
date: 2025-09-10T00:08:09Z
summary:

gh-135953: Fix refleak in cache method (#138721)

files:
M Lib/profiling/sampling/stack_collector.py

diff --git a/Lib/profiling/sampling/stack_collector.py 
b/Lib/profiling/sampling/stack_collector.py
index 9df8111c451de8..25539640b8de40 100644
--- a/Lib/profiling/sampling/stack_collector.py
+++ b/Lib/profiling/sampling/stack_collector.py
@@ -85,8 +85,9 @@ def export(self, filename):
 
         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:

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to