Mercurial > public > mercurial-scm > hg-stable
diff mercurial/utils/stringutil.py @ 49764:9be765b82a90
typing: minor tweaks to allow updating to pytype 2022.11.18
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 23 Nov 2022 11:22:22 -0500 |
parents | bbbb5213d043 |
children | 493034cc3265 |
line wrap: on
line diff
--- a/mercurial/utils/stringutil.py Sun Nov 20 22:54:43 2022 -0500 +++ b/mercurial/utils/stringutil.py Wed Nov 23 11:22:22 2022 -0500 @@ -723,11 +723,15 @@ s = bytes(s) # call underlying function of s.encode('string_escape') directly for # Python 3 compatibility + # pytype: disable=bad-return-type return codecs.escape_encode(s)[0] # pytype: disable=module-attr + # pytype: enable=bad-return-type def unescapestr(s: bytes) -> bytes: + # pytype: disable=bad-return-type return codecs.escape_decode(s)[0] # pytype: disable=module-attr + # pytype: enable=bad-return-type def forcebytestr(obj):