Fix 3.6 list if "and" comprehension bug

This commit is contained in:
rocky
2018-03-18 19:12:16 -04:00
parent 51dec051df
commit b9281c79be
3 changed files with 10 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,7 @@
# From 3.6 base64.py
# Bug was handling "and" condition in the presense of POP_JUMP_IF_FALSE
# locations
def _85encode(foldnuls, words):
return ['z' if foldnuls and word
else 'y'
for word in words]

View File

@@ -52,6 +52,9 @@ class Python36Parser(Python35Parser):
# This might be valid in < 3.6
and ::= expr jmp_false expr
jf_cf ::= JUMP_FORWARD COME_FROM
conditional ::= expr jmp_false expr jf_cf expr COME_FROM
# Adds a COME_FROM_ASYNC_WITH over 3.5
# FIXME: remove corresponding rule for 3.5?