mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
gh-69990: Make Profile.print_stats support sorting by multiple values (GH-104590)
Co-authored-by: Chiu-Hsiang Hsu
This commit is contained in:
parent
351c103134
commit
2a7a0020c9
5 changed files with 20 additions and 4 deletions
|
@ -41,7 +41,9 @@ class Profile(_lsprof.Profiler):
|
|||
|
||||
def print_stats(self, sort=-1):
|
||||
import pstats
|
||||
pstats.Stats(self).strip_dirs().sort_stats(sort).print_stats()
|
||||
if not isinstance(sort, tuple):
|
||||
sort = (sort,)
|
||||
pstats.Stats(self).strip_dirs().sort_stats(*sort).print_stats()
|
||||
|
||||
def dump_stats(self, file):
|
||||
import marshal
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue