summaryrefslogtreecommitdiff
path: root/x11-base/xcb-proto/files/xcb-proto-1.14-python3_9.patch
blob: 358cd629eb6de551ae7a254cff08408c505eb2cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
diff --git a/xcbgen/align.py b/xcbgen/align.py
index d4c12ee40195cb1986796bed009f5ba70dede1d3..5c4f5177dcb14753dabe6f0c8fee57781202efba 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):
 
diff --git a/xcbgen/matcher.py b/xcbgen/matcher.py
index 97a8b43bb24d29b6414b1e139c73cde966118ea8..a13ef2846fda2d2be249ca0c5dd06d35b90cf6cc 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 0dbecdc7b6f96bbf5f0e549787b20f9986039f1b..3b7eeb42bec1b00e5253aa93e58e0cd1fb7a3389 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 *