bpo-27494: Fix 2to3 handling of trailing comma after a generator expression by jstasiak · Pull Request #3771 · python/cpython (original) (raw)

While this is a valid Python 2 and Python 3 syntax lib2to3 would choke
on it:

set(x for x in [],)

This patch changes the grammar definition used by lib2to3 so that the
actual Python syntax is supported now and backwards compatibility is
preserved.

https://bugs.python.org/issue27494

Note: there are some issues with the build of the first pull request I created (#60) to merge this change so this is a replacement pull request I create, hoping it'll fix things.