Mercurial > public > mercurial-scm > hg
comparison mercurial/statprof.py @ 48939:37537a4d2695
statprof: remove superfluous sys.version_info check
Always true since we require Python 3 now.
Differential Revision: https://phab.mercurial-scm.org/D12345
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 21 Feb 2022 12:36:57 -0700 |
parents | 2cce2fa5bcf7 |
children | 642e31cb55f0 |
comparison
equal
deleted
inserted
replaced
48938:f98da1349212 | 48939:37537a4d2695 |
---|---|
605 function[4].sort(reverse=True, key=lambda i: i.selfseconds()) | 605 function[4].sort(reverse=True, key=lambda i: i.selfseconds()) |
606 for stat in function[4]: | 606 for stat in function[4]: |
607 # only show line numbers for significant locations (>1% time spent) | 607 # only show line numbers for significant locations (>1% time spent) |
608 if stat.selfpercent() > 1: | 608 if stat.selfpercent() > 1: |
609 source = stat.site.getsource(25) | 609 source = stat.site.getsource(25) |
610 if sys.version_info.major >= 3 and not isinstance( | 610 if not isinstance(source, bytes): |
611 source, bytes | |
612 ): | |
613 source = pycompat.bytestr(source) | 611 source = pycompat.bytestr(source) |
614 | 612 |
615 stattuple = ( | 613 stattuple = ( |
616 stat.selfpercent(), | 614 stat.selfpercent(), |
617 stat.selfseconds(), | 615 stat.selfseconds(), |