open-research / sumatra

http://neuralensemble.org/sumatra/
BSD 2-Clause "Simplified" License
127 stars 48 forks source link

async failure in Python 2.7 #384

Open appukuttan-shailesh opened 5 years ago

appukuttan-shailesh commented 5 years ago

The following files need to be deleted in Python 2.7 for sumatra.dependency_finder.find_dependencies to work:

Errors that arise are:

async def concat_async(async_gen):
       ^

SyntaxError: invalid syntax

and

transport, pw = yield from asyncio.get_event_loop()\
                        ^

SyntaxError: invalid syntax

From what I understand, the above files are functional only in Python 3.x.

@apdavison : On this line, there seems to be an effort to handle the issues arising out of async, but it seems to fail. Any quick fix to handle the above files?

Also, the above list of files are quite certainly only a sample of issues that might arise with Py 2 & 3 code in a single package. Is a more foolproof workaround possible, that for example might ignore or appropriately convert Py3 only statements (such as yield from ...)?