view tests/pathutil.py @ 286:a2d283d1033d

tests: Fixes for running on Windows. Mostly about those damn backslashes, as usual.
author Ludovic Chabant <ludovic@chabant.com>
date Wed, 04 Mar 2015 22:40:50 -0800
parents
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