view tests/pathutil.py @ 850:370e74941d32

optimize: Only load some 3rd party packages when needed. This commit only optimizes the Markdown, SmartyPants, and Pystache wrappers.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 29 Apr 2017 21:27:33 -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