Mercurial > piecrust2
view tests/pathutil.py @ 450:298f8f46432a
internal: Add a `fastpickle` module to help with multiprocess serialization.
Looks like we're wasting a lot of time serializing custom class information
for the workers, so this new module helps to convert classes to standard
structures (dicts, lists, etc).
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Mon, 06 Jul 2015 21:29:17 -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