diff options
author | Iwan Aucamp <aucampia@gmail.com> | 2021-06-01 23:51:38 +0200 |
---|---|---|
committer | Iwan Aucamp <aucampia@gmail.com> | 2021-06-01 23:51:38 +0200 |
commit | eedbe3c0495aef628aa0e5a3a5ccac5bdd9a9ead (patch) | |
tree | d0a91df1d388e65a1e8788f6976e9a23a20a248a /rdflib/compat.py | |
parent | 8e27d1915e3babd766c89a92109452554e568e14 (diff) | |
download | rdflib-eedbe3c0495aef628aa0e5a3a5ccac5bdd9a9ead.tar.gz |
Simplify importing of etree
Removed import of xml.etree.cElementTree as it was was
deprecated in python 3.3.
Also, since xml.etree.ElementTree has been a thing for a long time there is
no good reason to try fallbacks if it fails to import.
Diffstat (limited to 'rdflib/compat.py')
-rw-r--r-- | rdflib/compat.py | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/rdflib/compat.py b/rdflib/compat.py index 5c50766b..cac19453 100644 --- a/rdflib/compat.py +++ b/rdflib/compat.py @@ -14,25 +14,7 @@ else: try: from lxml import etree except ImportError: - try: - # Python 2.5 - import xml.etree.cElementTree as etree - except ImportError: - try: - # Python 2.5 - import xml.etree.ElementTree as etree - except ImportError: - try: - # normal cElementTree install - import cElementTree as etree - except ImportError: - try: - # normal ElementTree install - import elementtree.ElementTree as etree - except ImportError: - raise Exception( - "Failed to import ElementTree from any known place" - ) + import xml.etree.ElementTree as etree try: |