From ee72280e603eefa1de74e1137082134a2d661097 Mon Sep 17 00:00:00 2001 From: "Mr. Outis" Date: Wed, 18 Dec 2019 23:34:00 -0600 Subject: [PATCH] summon: left a comment about chdir and syspath --- dvc/api.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dvc/api.py b/dvc/api.py index b25001c15..38b324a65 100644 --- a/dvc/api.py +++ b/dvc/api.py @@ -113,6 +113,10 @@ def summon(name, args=None, repo=None, rev=None): @contextmanager def _chdir_and_syspath(path): + # XXX: Some issues with this approach: + # * Not thread safe + # * Import will pollute sys.modules + # * Weird errors if there is a name clash within sys.modules old_dir = os.path.abspath(os.curdir) os.chdir(path) sys.path.insert(0, path)