view tests/pathutil.py @ 907:3e69f18912f5

jinja: Remove Twig compatibility, add timer, improve code. - Add a timer for keeping track of extensions' performance. - Use the `select_template` function from Jinja to cut down on a few lines of code.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 23 Jul 2017 08:30:47 -0700
parents a2d283d1033d
children
line wrap: on
line source

import os


def slashfix(path):
    if path is None:
        return None
    if isinstance(path, str):
        return path.replace('/', os.sep)
    fixed = []
    for p in path:
        fixed.append(p.replace('/', os.sep))
    return fixed