diff --git a/check_manifest.py b/check_manifest.py index 23ab7da..b78d657 100755 --- a/check_manifest.py +++ b/check_manifest.py @@ -33,7 +33,12 @@ from distutils.filelist import glob_to_re from contextlib import contextmanager, closing from distutils.text_file import TextFile -from xml.etree import cElementTree as ET + +try: + from xml.etree import cElementTree as ET +except ImportError: + # Python 3.9+ + from xml.etree import ElementTree as ET try: import ConfigParser diff --git a/tests.py b/tests.py index acd10a6..4bb0cc5 100644 --- a/tests.py +++ b/tests.py @@ -14,7 +14,7 @@ import zipfile from contextlib import closing from io import BytesIO -from xml.etree import cElementTree as ET +from xml.etree import ElementTree as ET try: from cStringIO import StringIO # Python 2.x