mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
summon: left a comment about chdir and syspath
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user