Skip to content

Commit a75d1c1

Browse files
gh-158234: Fix a typo in the tracemalloc cumulative mode error message (#158233)
Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent 874736e commit a75d1c1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎Lib/tracemalloc.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ def _sort_key(self):
119119

120120
def _compare_grouped_stats(old_group, new_group):
121121
statistics = []
122+
old_group = dict(old_group)
122123
for traceback, stat in new_group.items():
123124
previous = old_group.pop(traceback, None)
124125
if previous is not None:
@@ -478,7 +479,7 @@ def _group_by(self, key_type, cumulative):
478479
if key_type not in ('traceback', 'filename', 'lineno'):
479480
raise ValueError("unknown key_type: %r" % (key_type,))
480481
if cumulative and key_type not in ('lineno', 'filename'):
481-
raise ValueError("cumulative mode cannot by used "
482+
raise ValueError("cumulative mode cannot be used "
482483
"with key type %r" % key_type)
483484

484485
stats = {}

0 commit comments

Comments
 (0)