Ensure that we use posix style strings instead of Path objects for chdir context manager

Signed-off-by: Dan Ryan <dan@danryan.co>
This commit is contained in:
Dan Ryan
2018-07-24 20:24:06 -04:00
parent 6e38560a7f
commit 1c6acfecb5
+3 -1
View File
@@ -1367,7 +1367,9 @@ def is_virtual_environment(path):
def chdir(path):
"""Context manager to change working directories."""
from ._compat import Path
prev_cwd = Path.cwd()
prev_cwd = Path.cwd().as_posix()
if isinstance(path, Path):
path = path.as_posix()
os.chdir(str(path))
try:
yield