]> granicus.if.org Git - python/commit
bpo-1875: Raise SyntaxError in invalid blocks that will be optimised away (GH-13332)
authorPablo Galindo <Pablogsal@gmail.com>
Fri, 17 May 2019 10:37:08 +0000 (11:37 +0100)
committerGitHub <noreply@github.com>
Fri, 17 May 2019 10:37:08 +0000 (11:37 +0100)
commitaf8646c8054d0f4180a2013383039b6a472f9698
treeceafae5989deb1ab62b8237593bd8752ab600e39
parenta8b46944d72bba6dc76260ed61da5c78d3f9d9c0
bpo-1875: Raise SyntaxError in invalid blocks that will be optimised away (GH-13332)

Move the check for dead conditionals (if 0) to the peephole optimizer
and make sure that the code block is still compiled to report any
existing syntax errors within.
Lib/test/test_syntax.py
Misc/NEWS.d/next/Core and Builtins/2019-05-15-01-29-29.bpo-1875.9oxXFX.rst [new file with mode: 0644]
Python/compile.c
Python/peephole.c