Patchwork D11920: statprof: convert a few exception byte strings to str

login
register
mail settings
Submitter phabricator
Date Dec. 14, 2021, 9:11 p.m.
Message ID <differential-rev-PHID-DREV-elgprlvpljtnyva72xxk-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50245/
State New
Headers show

Comments

phabricator - Dec. 14, 2021, 9:11 p.m.
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  That way these display without the b'' prefix.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D11920

AFFECTED FILES
  mercurial/statprof.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/statprof.py b/mercurial/statprof.py
--- a/mercurial/statprof.py
+++ b/mercurial/statprof.py
@@ -516,7 +516,7 @@ 
     elif format == DisplayFormats.Chrome:
         write_to_chrome(data, fp, **kwargs)
     else:
-        raise Exception(b"Invalid display format")
+        raise Exception("Invalid display format")
 
     if format not in (DisplayFormats.Json, DisplayFormats.Chrome):
         fp.write(b'---\n')
@@ -625,7 +625,7 @@ 
 
 def display_about_method(data, fp, function=None, **kwargs):
     if function is None:
-        raise Exception(b"Invalid function")
+        raise Exception("Invalid function")
 
     filename = None
     if b':' in function:
@@ -1080,7 +1080,7 @@ 
             printusage()
             return 0
         else:
-            assert False, b"unhandled option %s" % o
+            assert False, "unhandled option %s" % o
 
     if not path:
         print('must specify --file to load')