Fix Python 3.7
This commit is contained in:
parent
e8d97ac027
commit
d80bed9c5b
33
0001-Fix-syntax-error-on-Python-3.7.patch
Normal file
33
0001-Fix-syntax-error-on-Python-3.7.patch
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
From 0d3b7cc9ba787a139ecbe6dac490b1f5bb021b7f Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
|
||||||
|
Date: Wed, 27 Jun 2018 13:00:28 +0200
|
||||||
|
Subject: [PATCH] Fix syntax error on Python 3.7
|
||||||
|
|
||||||
|
async is a keyword now.
|
||||||
|
|
||||||
|
`asyncio import ensure_future` works on Python 3.4 to 3.7
|
||||||
|
|
||||||
|
`from asyncio import async as ensure_future` is not needed.
|
||||||
|
---
|
||||||
|
libvirtaio.py | 5 +----
|
||||||
|
1 file changed, 1 insertion(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/libvirtaio.py b/libvirtaio.py
|
||||||
|
index 1c432dd..b100a5f 100644
|
||||||
|
--- a/libvirtaio.py
|
||||||
|
+++ b/libvirtaio.py
|
||||||
|
@@ -43,10 +43,7 @@ import warnings
|
||||||
|
|
||||||
|
import libvirt
|
||||||
|
|
||||||
|
-try:
|
||||||
|
- from asyncio import ensure_future
|
||||||
|
-except ImportError:
|
||||||
|
- from asyncio import async as ensure_future
|
||||||
|
+from asyncio import ensure_future
|
||||||
|
|
||||||
|
|
||||||
|
class Callback(object):
|
||||||
|
--
|
||||||
|
2.17.0
|
||||||
|
|
@ -36,6 +36,7 @@ Name: libvirt-python
|
|||||||
Version: 4.4.0
|
Version: 4.4.0
|
||||||
Release: 2%{?dist}%{?extra_release}
|
Release: 2%{?dist}%{?extra_release}
|
||||||
Source0: http://libvirt.org/sources/python/%{name}-%{version}.tar.gz
|
Source0: http://libvirt.org/sources/python/%{name}-%{version}.tar.gz
|
||||||
|
Patch0: 0001-Fix-syntax-error-on-Python-3.7.patch
|
||||||
Url: http://libvirt.org
|
Url: http://libvirt.org
|
||||||
License: LGPLv2+
|
License: LGPLv2+
|
||||||
Group: Development/Libraries
|
Group: Development/Libraries
|
||||||
@ -107,7 +108,7 @@ of recent versions of Linux (and other OSes).
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%autosetup -p1
|
||||||
|
|
||||||
# Unset execute bit for example scripts; it can introduce spurious
|
# Unset execute bit for example scripts; it can introduce spurious
|
||||||
# RPM dependencies, like /usr/bin/python which can pull in python2
|
# RPM dependencies, like /usr/bin/python which can pull in python2
|
||||||
|
Loading…
Reference in New Issue
Block a user