summaryrefslogtreecommitdiffstats
path: root/Misc/NEWS.d
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2021-05-22 22:05:00 (GMT)
committerGitHub <noreply@github.com>2021-05-22 22:05:00 (GMT)
commitbd7476dae337e905e7b1bbf33ddb96cc270fdc84 (patch)
tree2d2db18ce2b6c7f3c7ee3df6da68523aa812ede2 /Misc/NEWS.d
parent2a1e6698b10a7b58c6ac66429de0f51cb739da35 (diff)
downloadcpython-bd7476dae337e905e7b1bbf33ddb96cc270fdc84.zip
cpython-bd7476dae337e905e7b1bbf33ddb96cc270fdc84.tar.gz
cpython-bd7476dae337e905e7b1bbf33ddb96cc270fdc84.tar.bz2
bpo-44201: Avoid side effects of "invalid_*" rules in the REPL (GH-26298)
When the parser does a second pass to check for errors, these rules can have some small side-effects as they may advance the parser more than the point reached in the first pass. This can cause the tokenizer to ask for extra tokens in interactive mode causing the tokenizer to show the prompt instead of failing instantly. To avoid this, add a new mode to the tokenizer that is activated in the second pass and deactivates asking for new tokens when the interactive line is finished. As the parsing should have reached the last line in the first pass, the second pass should not need to ask for more tokens.
Diffstat (limited to 'Misc/NEWS.d')
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2021-05-21-21-16-03.bpo-44201.bGaSjt.rst3
1 files changed, 3 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-05-21-21-16-03.bpo-44201.bGaSjt.rst b/Misc/NEWS.d/next/Core and Builtins/2021-05-21-21-16-03.bpo-44201.bGaSjt.rst
new file mode 100644
index 0000000..6f61aac
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2021-05-21-21-16-03.bpo-44201.bGaSjt.rst
@@ -0,0 +1,3 @@
+Avoid side effects of checking for specialized syntax errors in the REPL
+that was causing it to ask for extra tokens after a syntax error had been
+detected. Patch by Pablo Galindo