[PATCH 3 of 7] typing: fix argument type of encoding.tolocal() and .fromutf8b()

Yuya Nishihara yuya at tcha.org
Sat Nov 16 06:59:39 EST 2019


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1573885632 -32400
#      Sat Nov 16 15:27:12 2019 +0900
# Node ID e183fdce1d6d2b07531c4bf8ef7298631b9efbdc
# Parent  278616fbbe76deecad94eb99886b01aed6fe9661
typing: fix argument type of encoding.tolocal() and .fromutf8b()

Fixes various pytype errors.

diff --git a/mercurial/encoding.py b/mercurial/encoding.py
--- a/mercurial/encoding.py
+++ b/mercurial/encoding.py
@@ -138,7 +138,7 @@ class safelocalstr(bytes):
 
 
 def tolocal(s):
-    # type: (Text) -> bytes
+    # type: (bytes) -> bytes
     """
     Convert a string from internal UTF-8 to local encoding
 
@@ -648,7 +648,7 @@ def toutf8b(s):
 
 
 def fromutf8b(s):
-    # type: (Text) -> bytes
+    # type: (bytes) -> bytes
     '''Given a UTF-8b string, return a local, possibly-binary string.
 
     return the original binary string. This


More information about the Mercurial-devel mailing list