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
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
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
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
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
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