Skip to content

[split] Refactor / cleanup — from #21#37

Closed
pull-apart[bot] wants to merge 1 commit into
mainfrom
split-pr-21-1783449463-refactor
Closed

[split] Refactor / cleanup — from #21#37
pull-apart[bot] wants to merge 1 commit into
mainfrom
split-pr-21-1783449463-refactor

Conversation

@pull-apart

@pull-apart pull-apart Bot commented Jul 7, 2026

Copy link
Copy Markdown

Automated split from #21.

Context

This is the refactor / cleanup half of an automated split from #21.

Changes in this PR:

  • utilities/console.py: Added pty, shlex, subprocess, pexpect.fdpexpect imports.
  • Introduced _proc attribute to Console class to store subprocess.Popen instance.
  • Replaced direct pexpect.spawn calls with a new internal mechanism using pty.openpty() and subprocess.Popen.
  • Added _spawn_console() method to encapsulate the new console spawning logic.
  • Added _terminate_proc() method for cleanly shutting down the subprocess.
  • Updated connect() to use _spawn_console() and ensure _terminate_proc() is called on connection errors.
  • Updated disconnect() to check _proc status and call _terminate_proc() for cleanup.
  • Simplified console_eof_sampler() to use _spawn_console() internally and remove redundant parameters (func, command, timeout).
  • Changed exception handling in connect() from Exception to specific TimeoutExpiredError and pexpect.exceptions.ExceptionPexpect.
How this split maps your changes
  • Refactor branch (split-pr-21-1783449463-refactor): files classified as cleanup / mechanical work:
    • utilities/console.py
  • Main branch (split-pr-21-1783449463-main): files classified as feature / behavior work:
    • utilities/unittests/test_console.py

Merge order

Merge the refactor PR first if it touches shared files or would conflict with the main PR; then merge the main PR. Resolve conflicts in the usual way if both branches touch the same lines.

Main PR: #38

This was referenced Jul 7, 2026
@RoniKishner RoniKishner closed this Jul 7, 2026
@RoniKishner RoniKishner deleted the split-pr-21-1783449463-refactor branch July 7, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant