##// END OF EJS Templates
py3: replace os.altsep with pycompat.altsep...
Pulkit Goyal -
r30625:bcf4a975 default
parent child Browse files
Show More
@@ -143,7 +143,7 b' def staticfile(directory, fname, req):'
143 143 for part in parts:
144 144 if (part in ('', os.curdir, os.pardir) or
145 145 pycompat.ossep in part or
146 os.altsep is not None and os.altsep in part):
146 pycompat.osaltsep is not None and pycompat.osaltsep in part):
147 147 return
148 148 fpath = os.path.join(*parts)
149 149 if isinstance(directory, str):
@@ -1245,7 +1245,7 b' def stylemap(styles, paths=None):'
1245 1245 if (not style
1246 1246 or style in (os.curdir, os.pardir)
1247 1247 or pycompat.ossep in style
1248 or os.altsep and os.altsep in style):
1248 or pycompat.osaltsep and pycompat.osaltsep in style):
1249 1249 continue
1250 1250 locations = [os.path.join(style, 'map'), 'map-' + style]
1251 1251 locations.append('map')
@@ -1304,8 +1304,8 b' def fspath(name, root):'
1304 1304 return dict((normcase(n), n) for n in os.listdir(dir))
1305 1305
1306 1306 seps = pycompat.ossep
1307 if os.altsep:
1308 seps = seps + os.altsep
1307 if pycompat.osaltsep:
1308 seps = seps + pycompat.osaltsep
1309 1309 # Protect backslashes. This gets silly very quickly.
1310 1310 seps.replace('\\','\\\\')
1311 1311 pattern = remod.compile(r'([^%s]+)|([%s]+)' % (seps, seps))
@@ -1371,7 +1371,7 b' def checknlink(testfile):'
1371 1371 def endswithsep(path):
1372 1372 '''Check path ends with os.sep or os.altsep.'''
1373 1373 return (path.endswith(pycompat.ossep)
1374 or os.altsep and path.endswith(os.altsep))
1374 or pycompat.osaltsep and path.endswith(pycompat.osaltsep))
1375 1375
1376 1376 def splitpath(path):
1377 1377 '''Split path by os.sep.
General Comments 0
You need to be logged in to leave comments. Login now