Start an engine session with a provided CLI path.
(cfg: Config, path: str)
| 74 | |
| 75 | @contextlib.contextmanager |
| 76 | def start_cli_session_sync(cfg: Config, path: str): |
| 77 | """Start an engine session with a provided CLI path.""" |
| 78 | logger.debug("Starting session using %s", path) |
| 79 | try: |
| 80 | with contextlib.ExitStack() as stack: |
| 81 | session = stack.enter_context(run(cfg, path)) |
| 82 | params = get_connect_params(session) |
| 83 | stack.push(Pclose(session.proc)) |
| 84 | yield params |
| 85 | except (OSError, ValueError, TypeError) as e: |
| 86 | raise SessionError(e) from e |
| 87 | |
| 88 | |
| 89 | def _has_fileno(stream: TextIO) -> bool: |
no test coverage detected