https://github.com/python/cpython/commit/a75d1c197bb2bfc6c4cfea29c2f3827d564c7514
commit: a75d1c197bb2bfc6c4cfea29c2f3827d564c7514
branch: main
author: Tony <[email protected]>
committer: StanFromIreland <[email protected]>
date: 2026-10-21T17:31:24Z
summary:

gh-158234: Fix a typo in the `tracemalloc` cumulative mode error message 
(#158233)

Co-authored-by: Stan Ulbrych <[email protected]>

files:
M Lib/tracemalloc.py

diff --git a/Lib/tracemalloc.py b/Lib/tracemalloc.py
index cec99c59700fe0..426981ebe97b4d 100644
--- a/Lib/tracemalloc.py
+++ b/Lib/tracemalloc.py
@@ -119,6 +119,7 @@ def _sort_key(self):
 
 def _compare_grouped_stats(old_group, new_group):
     statistics = []
+    old_group = dict(old_group)
     for traceback, stat in new_group.items():
         previous = old_group.pop(traceback, None)
         if previous is not None:
@@ -478,7 +479,7 @@ def _group_by(self, key_type, cumulative):
         if key_type not in ('traceback', 'filename', 'lineno'):
             raise ValueError("unknown key_type: %r" % (key_type,))
         if cumulative and key_type not in ('lineno', 'filename'):
-            raise ValueError("cumulative mode cannot by used "
+            raise ValueError("cumulative mode cannot be used "
                              "with key type %r" % key_type)
 
         stats = {}

_______________________________________________
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