mercurial/statprof.py
changeset 48939 37537a4d2695
parent 48935 2cce2fa5bcf7
child 48946 642e31cb55f0
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(),