diff --git a/mercurial/hgweb/common.py b/mercurial/hgweb/common.py --- a/mercurial/hgweb/common.py +++ b/mercurial/hgweb/common.py @@ -143,7 +143,7 @@ def staticfile(directory, fname, req): for part in parts: if (part in ('', os.curdir, os.pardir) or pycompat.ossep in part or - os.altsep is not None and os.altsep in part): + pycompat.osaltsep is not None and pycompat.osaltsep in part): return fpath = os.path.join(*parts) if isinstance(directory, str): diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -1245,7 +1245,7 @@ def stylemap(styles, paths=None): if (not style or style in (os.curdir, os.pardir) or pycompat.ossep in style - or os.altsep and os.altsep in style): + or pycompat.osaltsep and pycompat.osaltsep in style): continue locations = [os.path.join(style, 'map'), 'map-' + style] locations.append('map') diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -1304,8 +1304,8 @@ def fspath(name, root): return dict((normcase(n), n) for n in os.listdir(dir)) seps = pycompat.ossep - if os.altsep: - seps = seps + os.altsep + if pycompat.osaltsep: + seps = seps + pycompat.osaltsep # Protect backslashes. This gets silly very quickly. seps.replace('\\','\\\\') pattern = remod.compile(r'([^%s]+)|([%s]+)' % (seps, seps)) @@ -1371,7 +1371,7 @@ def checknlink(testfile): def endswithsep(path): '''Check path ends with os.sep or os.altsep.''' return (path.endswith(pycompat.ossep) - or os.altsep and path.endswith(os.altsep)) + or pycompat.osaltsep and path.endswith(pycompat.osaltsep)) def splitpath(path): '''Split path by os.sep.