[issue32496] lib2to3 fails to parse a ** of a conditional expression

Gregory P. Smith report at bugs.python.org
Thu Jan 4 18:28:09 EST 2018


New submission from Gregory P. Smith <greg at krypto.org>:

see the attached sample code demonstrating the problem.

basically lib2to3 fails to parse:

  dummy(**kwargs if kwargs else dict())

with an error like:

    raise ParseError("bad input", type, value, context)
lib2to3.pgen2.parse.ParseError: bad input: type=1, value='if', context=(' ', (3, 21))

----------
components: 2to3 (2.x to 3.x conversion tool)
files: repro_2to3_prob.py
messages: 309488
nosy: gregory.p.smith
priority: normal
severity: normal
status: open
title: lib2to3 fails to parse a ** of a conditional expression
versions: Python 2.7, Python 3.6, Python 3.7
Added file: https://bugs.python.org/file47365/repro_2to3_prob.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32496>
_______________________________________


More information about the Python-bugs-list mailing list