[Updated] D10122: shelve: fix conversion of exceptions to strings flagged by pytype

mharbison72 (Matt Harbison) phabricator at mercurial-scm.org
Mon Mar 8 20:25:13 UTC 2021


Closed by commit rHGe571fec5b606: shelve: fix conversion of exceptions to strings flagged by pytype (authored by mharbison72).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D10122?vs=26119&id=26129

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D10122/new/

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

AFFECTED FILES
  mercurial/shelve.py

CHANGE DETAILS

diff --git a/mercurial/shelve.py b/mercurial/shelve.py
--- a/mercurial/shelve.py
+++ b/mercurial/shelve.py
@@ -241,7 +241,7 @@
                 bin(h) for h in d[b'nodestoremove'].split(b' ')
             ]
         except (ValueError, TypeError, KeyError) as err:
-            raise error.CorruptedState(pycompat.bytestr(err))
+            raise error.CorruptedState(stringutil.forcebytestr(err))
 
     @classmethod
     def _getversion(cls, repo):
@@ -250,7 +250,7 @@
         try:
             version = int(fp.readline().strip())
         except ValueError as err:
-            raise error.CorruptedState(pycompat.bytestr(err))
+            raise error.CorruptedState(stringutil.forcebytestr(err))
         finally:
             fp.close()
         return version



To: mharbison72, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210308/820a0119/attachment-0002.html>


More information about the Mercurial-patches mailing list