API refactor
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-10-07 16:25:52 +09:00
parent 76d0d86211
commit 91c7e04474
1171 changed files with 81940 additions and 44117 deletions

View File

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