This commit is contained in:
@@ -51,13 +51,8 @@ def instantiate(name, *args, **kwargs):
|
||||
@contextmanager
|
||||
def cwd_in_path():
|
||||
"""Context adding the current working directory to sys.path."""
|
||||
try:
|
||||
cwd = os.getcwd()
|
||||
except FileNotFoundError:
|
||||
cwd = None
|
||||
if not cwd:
|
||||
yield
|
||||
elif cwd in sys.path:
|
||||
cwd = os.getcwd()
|
||||
if cwd in sys.path:
|
||||
yield
|
||||
else:
|
||||
sys.path.insert(0, cwd)
|
||||
|
||||
Reference in New Issue
Block a user