mirror of
https://github.com/facebook/sapling.git
synced 2024-10-08 15:57:43 +03:00
a4d520acc6
Summary: The mix use of `os.path` and `pathlib` in `redirect.py` is a little messy, which is making adding Windows support trickier since `os.path` functions do not accept `Path` until 3.8. So before I make the change I think it's better to clean it up. Since we are target Python 3 nowadays, replacing `os.path` with `pathlib` seems to be better. Basically this diff does the following: * Replace use of `os.path` functions with the counterpart in `pathlib`. * Reduce unnecessary conversions from/to `Path` to `str` / `bytes`. * Only convert `Path` to `str` or `bytes` when interactive with other APIs (Thrift or os) * Cross-platform APIs: `os.fspath` * API expecting `str`: `os.fsdecode` * API expecting `bytes`: `os.fsencode` Reviewed By: chadaustin Differential Revision: D22879004 fbshipit-source-id: a247973dc9919c8805daa4046472124310725516 |
||
---|---|---|
.. | ||
benchharness | ||
benchmarks | ||
cli | ||
config | ||
docs | ||
fuse | ||
inodes | ||
journal | ||
model | ||
monitor | ||
notifications | ||
py | ||
rocksdb | ||
service | ||
sqlite | ||
store | ||
takeover | ||
telemetry | ||
testharness | ||
third-party | ||
utils | ||
win | ||
CMakeLists.txt |