view tests/pathutil.py @ 1148:0aeb6f18d6a0

bake: Don't crash if a source doesn't implement related items.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 10 Jul 2018 21:01:45 -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