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

Cole Robinson crobinso at redhat.com
Tue Jun 26 14:27:13 UTC 2018


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 syntax
> 
> Switch to getattr trickery to accomplish the same goal
> 
> Signed-off-by: Cole Robinson <crobinso at redhat.com>
> ---
>  libvirtaio.py | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> If we don't care about python3 < 3.4.4 compat, we can just do
> 
>   from asyncio import ensure_future
> 

Also I meant to say, this was prompted by python3.7 rebase in Fedora:

https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/5DOPLN7K7GCI3T6ZMXDBIPJW5Y7ESGYS/




More information about the libvir-list mailing list