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

login
register
mail settings
Submitter Yuya Nishihara
Date Nov. 16, 2019, 11:59 a.m.
Message ID <e183fdce1d6d2b07531c.1573905579@mimosa>
Download mbox | patch
Permalink /patch/43295/
State Accepted
Headers show

Comments

Yuya Nishihara - Nov. 16, 2019, 11:59 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@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.

Patch

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