Handle NoneType paths

Signed-off-by: Dan Ryan <dan@danryan.co>
This commit is contained in:
Dan Ryan
2018-07-24 20:31:27 -04:00
parent 1c6acfecb5
commit c584739b41
+2
View File
@@ -1367,6 +1367,8 @@ def is_virtual_environment(path):
def chdir(path):
"""Context manager to change working directories."""
from ._compat import Path
if not path:
return
prev_cwd = Path.cwd().as_posix()
if isinstance(path, Path):
path = path.as_posix()