Patchwork [6,of,7] typing: fix argument type of encoding.localstr()

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

Comments

Yuya Nishihara - Nov. 16, 2019, 11:59 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1573885489 -32400
#      Sat Nov 16 15:24:49 2019 +0900
# Node ID e958a138ca580a7ab1565df30e3737dbf04a5a34
# Parent  e4db6b41230a04e20c67d87fc97ff90151369cae
typing: fix argument type of encoding.localstr()

It takes both utf-8 and local strings in bytes type.

Patch

diff --git a/mercurial/encoding.py b/mercurial/encoding.py
--- a/mercurial/encoding.py
+++ b/mercurial/encoding.py
@@ -117,7 +117,7 @@  class localstr(bytes):
     round-tripped to the local encoding and back'''
 
     def __new__(cls, u, l):
-        # type: (Type[_Tlocalstr], Text, bytes) -> _Tlocalstr
+        # type: (Type[_Tlocalstr], bytes, bytes) -> _Tlocalstr
         s = bytes.__new__(cls, l)
         s._utf8 = u
         return s