]> granicus.if.org Git - python/commit
bpo-37269: Correctly optimise conditionals with constant booleans (GH-14071)
authorPablo Galindo <Pablogsal@gmail.com>
Fri, 14 Jun 2019 05:54:53 +0000 (06:54 +0100)
committerGitHub <noreply@github.com>
Fri, 14 Jun 2019 05:54:53 +0000 (06:54 +0100)
commit05f831865545b08c9a21cfb7773af58b76ec64cb
tree439a8f94ee9aca75bf386902ace8b04eaa8fa0e9
parentd0eeb936d8daf05d7d89f6935e3f4c0dee49c5be
bpo-37269: Correctly optimise conditionals with constant booleans (GH-14071)

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.
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