Require Python 3.6 or later, making conditional imports no longer required

Signed-off-by: Robert Knutsson <zybreak@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/proto/xcbproto/-/merge_requests/64>
This commit is contained in:
Robert Knutsson 2025-10-20 22:04:37 +02:00
parent 5305be7e11
commit b4609e1cd7
5 changed files with 5 additions and 26 deletions

View file

@ -14,7 +14,7 @@ if test "$XMLLINT" = "no"; then
AC_MSG_WARN([xmllint not found; unable to validate against schema.])
fi
AM_PATH_PYTHON([3.0])
AM_PATH_PYTHON([3.6])
xcbincludedir='${datadir}/xcb'
AC_SUBST(xcbincludedir)

View file

@ -2,12 +2,7 @@
This module contains helper classes for alignment arithmetic and checks
'''
from sys import version_info
if version_info[:2] >= (3, 5):
from math import gcd
else:
from fractions import gcd
from math import gcd
class Alignment(object):

View file

@ -7,12 +7,7 @@ we do not create a new type object, we just record the existing one under a new
'''
from os.path import join
from sys import version_info
if version_info[:2] >= (3, 3):
from xml.etree.ElementTree import parse
else:
from xml.etree.cElementTree import parse
from xml.etree.ElementTree import parse
from xcbgen.xtypes import *

View file

@ -2,13 +2,7 @@
This module contains the namespace class and the singleton module class.
'''
from os.path import dirname, basename
from sys import version_info
if version_info[:2] >= (3, 3):
from xml.etree.ElementTree import parse
else:
from xml.etree.cElementTree import parse
from xml.etree.ElementTree import parse
from xcbgen import matcher
from xcbgen.error import *
from xcbgen.xtypes import *

View file

@ -1,14 +1,9 @@
'''
This module contains the classes which represent XCB data types.
'''
import sys
from xcbgen.expr import Field, Expression
from xcbgen.align import Alignment, AlignmentLog
if sys.version_info[:2] >= (3, 3):
from xml.etree.ElementTree import SubElement
else:
from xml.etree.cElementTree import SubElement
from xml.etree.ElementTree import SubElement
import __main__