Skip to content

Commit

Permalink
cleanup logging
Browse files Browse the repository at this point in the history
  • Loading branch information
mlasevich committed Sep 19, 2024
1 parent 93f5ac1 commit 02b1eaa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/fastapi_cli/discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ class ModuleData:

@contextmanager
def sys_path(self) -> Iterator[str]:
"""Context manaxger to temporarily alter sys.path"""
"""Context manager to temporarily alter sys.path"""
extra_sys_path = str(self.extra_sys_path) if self.extra_sys_path else ""
if extra_sys_path:
logger.warning("Adding %s to sys.path...", extra_sys_path)
logger.debug("Adding %s to sys.path...", extra_sys_path)
sys.path.insert(0, extra_sys_path)
yield extra_sys_path
if extra_sys_path and sys.path and sys.path[0] == extra_sys_path:
logger.warning("Removing %s from sys.path...", extra_sys_path)
logger.debug("Removing %s from sys.path...", extra_sys_path)
sys.path.pop(0)


Expand Down

0 comments on commit 02b1eaa

Please sign in to comment.