Mercurial > public > mercurial-scm > hg-stable
diff mercurial/utils/stringutil.py @ 51874:4eccb65e444f
utils: accept bytearray arguments for escapestr
author | Joerg Sonnenberger <joerg@bec.de> |
---|---|
date | Wed, 28 Aug 2024 23:25:26 +0200 |
parents | 278af66e6595 |
children | f4733654f144 |
line wrap: on
line diff
--- a/mercurial/utils/stringutil.py Sun Jun 30 16:02:50 2024 +0200 +++ b/mercurial/utils/stringutil.py Wed Aug 28 23:25:26 2024 +0200 @@ -724,7 +724,7 @@ def escapestr(s: bytes) -> bytes: # "bytes" is also a typing shortcut for bytes, bytearray, and memoryview - if isinstance(s, memoryview): + if isinstance(s, (memoryview, bytearray)): s = bytes(s) # call underlying function of s.encode('string_escape') directly for # Python 3 compatibility