8000 gh-124703: Change back to raising bdb.BdbQuit when exiting pdb in 'inline' mode in a REPL session by ADThomas-astro · Pull Request #130395 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-124703: Change back to raising bdb.BdbQuit when exiting pdb in 'inline' mode in a REPL session #130395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Feb 25, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Import 'spwan_repl' from test_reply.py
  • Loading branch information
ADThomas-astro committed Feb 24, 2025
commit 5864a354a5ddf1e5b00048065b87f4158f081954
17 changes: 1 addition & 16 deletions Lib/test/test_pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -4345,22 +4345,6 @@ def test_quit(self):
self.assertEqual(stdout.count(QUIT_PROMPT_QUESTION), 2)


def spawn_repl():
"""Run the basic Python REPL. Returns a Popen object."""
# This function is based on the function "spawn_repl" in test_repl.py.
# See comments there for the rationale for the command line args.
stdin_fname = os.path.join(os.path.dirname(sys.executable), '<stdin>')
proc = subprocess.Popen(
[stdin_fname, '-I', '-i'],
executable=sys.executable,
text=True,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
)
return proc


@support.force_not_colorized_test_class
@support.requires_subprocess()
class TestREPLSession(unittest.TestCase):
Expand All @@ -4373,6 +4357,7 @@ def test_return_from_inline_mode_to_REPL(self):
pdb.set_trace(commands=['x * 3', 'q'])
x[::-1] * 3
"""
from test.test_repl import spawn_repl
p = spawn_repl()
p.stdin.write(textwrap.dedent(user_input))
output = kill_python(p)
Expand Down
Loading
0