summon: left a comment about chdir and syspath

This commit is contained in:
Mr. Outis
2019-12-18 23:34:00 -06:00
parent 4273ff49b3
commit ee72280e60
+4
View File
@@ -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)