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

login
register
mail settings
Submitter Yuya Nishihara
Date March 2, 2018, 12:26 a.m.
Message ID <a7eb4c25e04e5be83918.1519950388@mimosa>
Download mbox | patch
Permalink /patch/28633/
State Accepted
Headers show

Comments

Yuya Nishihara - March 2, 2018, 12:26 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@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

Patch

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: