diff mercurial/hgweb/webutil.py @ 36714:250f3168d907

hgweb: fix up trailing slash detection on Python 3 Fixes a couple of hgweb tests. Differential Revision: https://phab.mercurial-scm.org/D2661
author Augie Fackler <augie@google.com>
date Sun, 04 Mar 2018 13:04:12 -0500
parents a2fa51415ddc
children 1a1972b1a1ff
line wrap: on
line diff
--- a/mercurial/hgweb/webutil.py	Sun Mar 04 13:03:22 2018 -0500
+++ b/mercurial/hgweb/webutil.py	Sun Mar 04 13:04:12 2018 -0500
@@ -38,9 +38,9 @@
 )
 
 def up(p):
-    if p[0] != "/":
+    if p[0:1] != "/":
         p = "/" + p
-    if p[-1] == "/":
+    if p[-1:] == "/":
         p = p[:-1]
     up = os.path.dirname(p)
     if up == "/":