[PATCH 09 of 10] py3: replace type 'str' by 'bytes' in templater.py

Yuya Nishihara yuya at tcha.org
Thu Mar 1 19:26:28 EST 2018


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1519945585 18000
#      Thu Mar 01 18:06:25 2018 -0500
# Node ID a7eb4c25e04e5be83918ed160dfff78e782165c1
# Parent  42239a898f18efa768297ab43b016793726834cd
py3: replace type 'str' by 'bytes' in templater.py

diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -968,7 +968,7 @@ def localdate(context, mapping, args):
     if len(args) >= 2:
         tzoffset = None
         tz = evalfuncarg(context, mapping, args[1])
-        if isinstance(tz, str):
+        if isinstance(tz, bytes):
             tzoffset, remainder = util.parsetimezone(tz)
             if remainder:
                 tzoffset = None
@@ -1602,10 +1602,10 @@ def stylemap(styles, paths=None):
 
     if paths is None:
         paths = templatepaths()
-    elif isinstance(paths, str):
+    elif isinstance(paths, bytes):
         paths = [paths]
 
-    if isinstance(styles, str):
+    if isinstance(styles, bytes):
         styles = [styles]
 
     for style in styles:


More information about the Mercurial-devel mailing list