]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.7] bpo-37269: Correctly optimise conditionals with constant booleans (GH-14071...
authorPablo Galindo <Pablogsal@gmail.com>
Fri, 14 Jun 2019 06:18:51 +0000 (07:18 +0100)
committerGitHub <noreply@github.com>
Fri, 14 Jun 2019 06:18:51 +0000 (07:18 +0100)
commit5292179afc6fd0dc533add054d4790773c9766d0
tree92cb11639e7834233f8d83a112d8d7d0491513f2
parent6a433f5ae63de72a85d20b05ff826c6f72d529b7
[3.7] bpo-37269: Correctly optimise conditionals with constant booleans (GH-14071) (GH-14073)

Fix a regression introduced by af8646c8054d0f4180a2013383039b6a472f9698 that was causing code of the form:

if True and False:
   do_something()

to be optimized incorrectly, eliminating the block..
(cherry picked from commit 05f831865545b08c9a21cfb7773af58b76ec64cb)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Lib/test/test_peepholer.py
Misc/NEWS.d/next/Core and Builtins/2019-06-14-06-32-33.bpo-37269.SjVVAe.rst [new file with mode: 0644]
Python/peephole.c