mercurial/utils/stringutil.py
changeset 51828 4eccb65e444f
parent 51725 278af66e6595
child 51859 f4733654f144
--- 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