ply uses print as statement throughout ply.cpp, which doesn't work Python3. Possible fixes are a pass through 2to3, or restricting 3.x in the ebuild. Thanks, James Reproducible: Always
I have reported this problem to upstream.
A part of response from upstream: "ply/cpp.py is work in progress and doesn't work with any version of Python (it doesn't matter if it's broken because it's not used by anything else)."
Fixed by upstream in dev-python/ply-3.4.