]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-121610: pyrepl - handle extending blocks when multi-statement blocks are pasted...
authorsaucoide <32314353+saucoide@users.noreply.github.com>
Mon, 15 Jul 2024 23:33:57 +0000 (01:33 +0200)
committerGitHub <noreply@github.com>
Mon, 15 Jul 2024 23:33:57 +0000 (01:33 +0200)
commit7d111dac160c658b277ec0fac75eee8edcfbe9dc
tree4671db9a11fa54aa4bc94035ed3497d69f3d78cd
parent2b1b68939b15b913080a3403e3ba18e2a1f520ef
gh-121610: pyrepl - handle extending blocks when multi-statement blocks are pasted (GH-121757)

console.compile with the "single" param throws an exception when
there are multiple statements, never allowing to adding newlines
to a pasted code block (gh-121610)

This add a few extra checks to allow extending when in an indented
block, and tests for a few examples

Co-authored-by: Ɓukasz Langa <lukasz@langa.pl>
Lib/_pyrepl/simple_interact.py
Lib/test/test_pyrepl/test_interact.py