view tests/pathutil.py @ 367:734f2abf361c

config: Add method to deep-copy a config and validate its contents. Deep-copying will be problematic if non-basic types are in there, so there's a new method to check that this is OK.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 03 May 2015 18:42:29 -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