]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-121610: pyrepl - handle extending blocks when multi-statement blocks are...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 16 Jul 2024 06:28:41 +0000 (08:28 +0200)
committerGitHub <noreply@github.com>
Tue, 16 Jul 2024 06:28:41 +0000 (08:28 +0200)
commit73f77e642a4b67348274efa12d6671f957d7f41f
tree600e0845f13303dc72f594efa6295194bb788fab
parenta1505afd392b91553d19b63841628d6ef3b3e7f9
[3.13] gh-121610: pyrepl - handle extending blocks when multi-statement blocks are pasted (GH-121757) (GH-121825)

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 adds a few extra checks to allow extending when in an indented
block, and tests for a few examples.

(cherry picked from commit 7d111dac160c658b277ec0fac75eee8edcfbe9dc)

Co-authored-by: saucoide <32314353+saucoide@users.noreply.github.com>
Co-authored-by: Ɓukasz Langa <lukasz@langa.pl>
Lib/_pyrepl/simple_interact.py
Lib/test/test_pyrepl/test_interact.py