[Xcb-commit] xcb/proto: 2 commits - xcbgen
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jun 2 17:25:35 UTC 2020
xcbgen/align.py | 7 ++++++-
xcbgen/matcher.py | 7 ++++++-
xcbgen/state.py | 7 ++++++-
3 files changed, 18 insertions(+), 3 deletions(-)
New commits:
commit 7d58eed95f796fc764741d7549ee2214bbbcc64c
Author: Björn Esser <besser82 at fedoraproject.org>
Date: Mon Jun 1 12:29:01 2020 +0200
xcbgen: xml.etree.cElementTree has been dropped in Python 3.9.
It can be replaced with xml.etree.ElementTree safely.
Signed-off-by: Björn Esser <besser82 at fedoraproject.org>
diff --git a/xcbgen/matcher.py b/xcbgen/matcher.py
index 97a8b43..a13ef28 100644
--- a/xcbgen/matcher.py
+++ b/xcbgen/matcher.py
@@ -7,7 +7,12 @@ we do not create a new type object, we just record the existing one under a new
'''
from os.path import join
-from xml.etree.cElementTree import parse
+from sys import version_info
+
+if version_info[:2] >= (3, 9):
+ from xml.etree.ElementTree import parse
+else:
+ from xml.etree.cElementTree import parse
from xcbgen.xtypes import *
diff --git a/xcbgen/state.py b/xcbgen/state.py
index 0dbecdc..3b7eeb4 100644
--- a/xcbgen/state.py
+++ b/xcbgen/state.py
@@ -2,7 +2,12 @@
This module contains the namespace class and the singleton module class.
'''
from os.path import dirname, basename
-from xml.etree.cElementTree import parse
+from sys import version_info
+
+if version_info[:2] >= (3, 9):
+ from xml.etree.ElementTree import parse
+else:
+ from xml.etree.cElementTree import parse
from xcbgen import matcher
from xcbgen.error import *
commit 426ae35bee1fa0fdb8b5120b1dcd20cee6e34512
Author: Björn Esser <besser82 at fedoraproject.org>
Date: Mon Jun 1 12:24:16 2020 +0200
xcbgen: Use math.gcd() for Python >= 3.5.
fractions.gcd() has been deprecated since Python 3.5, and
was finally dropped in Python 3.9. It is recommended to
use math.gcd() instead.
Signed-off-by: Björn Esser <besser82 at fedoraproject.org>
diff --git a/xcbgen/align.py b/xcbgen/align.py
index d4c12ee..5c4f517 100644
--- a/xcbgen/align.py
+++ b/xcbgen/align.py
@@ -2,7 +2,12 @@
This module contains helper classes for alignment arithmetic and checks
'''
-from fractions import gcd
+from sys import version_info
+
+if version_info[:2] >= (3, 5):
+ from math import gcd
+else:
+ from fractions import gcd
class Alignment(object):
More information about the xcb-commit
mailing list