hgweb: fix a few `str` type conditional for py3 stable
authorMatt Harbison <matt_harbison@yahoo.com>
Sat, 30 Nov 2019 02:53:39 -0500
branchstable
changeset 43742 6ff1a0d109c9
parent 43741 8accf5fa9930
child 43743 66210a20f727
hgweb: fix a few `str` type conditional for py3 Differential Revision: https://phab.mercurial-scm.org/D7534
mercurial/hgweb/common.py
mercurial/hgweb/hgwebdir_mod.py
mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/common.py	Sat Nov 30 02:38:42 2019 -0500
+++ b/mercurial/hgweb/common.py	Sat Nov 30 02:53:39 2019 -0500
@@ -193,7 +193,7 @@
         return
 
     fpath = os.path.join(*fname.split(b'/'))
-    if isinstance(directory, str):
+    if isinstance(directory, bytes):
         directory = [directory]
     for d in directory:
         path = os.path.join(d, fpath)
--- a/mercurial/hgweb/hgwebdir_mod.py	Sat Nov 30 02:38:42 2019 -0500
+++ b/mercurial/hgweb/hgwebdir_mod.py	Sat Nov 30 02:53:39 2019 -0500
@@ -412,7 +412,7 @@
                 static = self.ui.config(b"web", b"static", untrusted=False)
                 if not static:
                     tp = self.templatepath or templater.templatepaths()
-                    if isinstance(tp, str):
+                    if isinstance(tp, bytes):
                         tp = [tp]
                     static = [os.path.join(p, b'static') for p in tp]
 
--- a/mercurial/hgweb/webcommands.py	Sat Nov 30 02:38:42 2019 -0500
+++ b/mercurial/hgweb/webcommands.py	Sat Nov 30 02:53:39 2019 -0500
@@ -1321,7 +1321,7 @@
     static = web.config(b"web", b"static", untrusted=False)
     if not static:
         tp = web.templatepath or templater.templatepaths()
-        if isinstance(tp, str):
+        if isinstance(tp, bytes):
             tp = [tp]
         static = [os.path.join(p, b'static') for p in tp]