Patchwork D7534: hgweb: fix a few `str` type conditional for py3

login
register
mail settings
Submitter phabricator
Date Dec. 2, 2019, 9:56 p.m.
Message ID <fa6be747dae351f091657b2d2d1021da@localhost.localdomain>
Download mbox | patch
Permalink /patch/43572/
State Not Applicable
Headers show

Comments

phabricator - Dec. 2, 2019, 9:56 p.m.
Closed by commit rHG6ff1a0d109c9: hgweb: fix a few `str` type conditional for py3 (authored by mharbison72).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7534?vs=18410&id=18427

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7534/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7534

AFFECTED FILES
  mercurial/hgweb/common.py
  mercurial/hgweb/hgwebdir_mod.py
  mercurial/hgweb/webcommands.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers, dlax, pulkit
Cc: mercurial-devel

Patch

diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -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]
 
diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgwebdir_mod.py
+++ b/mercurial/hgweb/hgwebdir_mod.py
@@ -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]
 
diff --git a/mercurial/hgweb/common.py b/mercurial/hgweb/common.py
--- a/mercurial/hgweb/common.py
+++ b/mercurial/hgweb/common.py
@@ -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)