# HG changeset patch # User Yuya Nishihara # Date 2019-11-16 07:09:39 # Node ID 7f51bc36194dad67d3197682746092d34cc65690 # Parent 83a349aaeba3818bff59c9abcf7bdb6caed61b1f typing: suppress error of py2 encoding.strtolocal() and .strfromlocal() I don't know how to conditionally get rid of these py2/py3 overloads from .pyi file. Instead, this patch makes pytype ignore the false-positives: line 271, in strtolocal: bad option in return type [bad-return-type] Expected: bytes Actually returned: str diff --git a/mercurial/encoding.py b/mercurial/encoding.py --- a/mercurial/encoding.py +++ b/mercurial/encoding.py @@ -268,11 +268,11 @@ else: def strtolocal(s): # type: (str) -> bytes - return s + return s # pytype: disable=bad-return-type def strfromlocal(s): # type: (bytes) -> str - return s + return s # pytype: disable=bad-return-type strmethod = pycompat.identity