view tests/pathutil.py @ 1183:62900c42d6dd

admin: Don't pass a custom environment to sub-processes. Apparently I was trying to be too clever, it's causing problems in some cases.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 21 May 2020 22:10:04 -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