[libvirt] [PATCH python] libvirtaio: Fix compat with python 3.7

2018-06-25 Thread Cole Robinson
In python 3.7, async is now a keyword, so this throws a syntax error: File "/usr/lib64/python3.7/site-packages/libvirtaio.py", line 49 from asyncio import async as ensure_future ^ SyntaxError: invalid syntax Switch to getattr trickery to accomplish the same goa

Re: [libvirt] [PATCH python] libvirtaio: Fix compat with python 3.7

2018-06-26 Thread Cole Robinson
On 06/25/2018 02:35 PM, Cole Robinson wrote: > In python 3.7, async is now a keyword, so this throws a syntax error: > > File "/usr/lib64/python3.7/site-packages/libvirtaio.py", line 49 > from asyncio import async as ensure_future > ^ > SyntaxError: invalid synt

Re: [libvirt] [PATCH python] libvirtaio: Fix compat with python 3.7

2018-06-26 Thread Andrea Bolognani
On Mon, 2018-06-25 at 14:35 -0400, Cole Robinson wrote: > If we don't care about python3 < 3.4.4 compat, we can just do > > from asyncio import ensure_future Debian 8, which is still a supported target platform[1], only has Python 3.4.2. [1] At least for libvirt; I'm going to assume libvirt-p

Re: [libvirt] [PATCH python] libvirtaio: Fix compat with python 3.7

2018-06-27 Thread Pavel Hrdina
On Mon, Jun 25, 2018 at 02:35:28PM -0400, Cole Robinson wrote: > In python 3.7, async is now a keyword, so this throws a syntax error: > > File "/usr/lib64/python3.7/site-packages/libvirtaio.py", line 49 > from asyncio import async as ensure_future > ^ > SyntaxE

Re: [libvirt] [PATCH python] libvirtaio: Fix compat with python 3.7

2018-06-27 Thread Andrea Bolognani
On Mon, 2018-06-25 at 14:35 -0400, Cole Robinson wrote: [...] > -try: > -from asyncio import ensure_future > -except ImportError: > -from asyncio import async as ensure_future > +# python < 3.4.4: we want 'async' > +# python >= 3.4.4 < 3.7, we want 'ensure_future' > +# python >= 3.7, 'async

Re: [libvirt] [PATCH python] libvirtaio: Fix compat with python 3.7

2018-06-27 Thread Cole Robinson
On 06/27/2018 07:50 AM, Andrea Bolognani wrote: > On Mon, 2018-06-25 at 14:35 -0400, Cole Robinson wrote: > [...] >> -try: >> -from asyncio import ensure_future >> -except ImportError: >> -from asyncio import async as ensure_future >> +# python < 3.4.4: we want 'async' >> +# python >= 3.4.4