Skip to content

Commit 7e52b16

Browse files
tirangsnedders
authored andcommitted
Don't use cElementTree on Python 3
It's been deprecated and will be removed in 3.9 or 3.10. 3.9.0b1 doesn't have cElementTree. I'd like to bring it back with a deprecation warning to drop in 3.10. See: python/cpython#19921 Signed-off-by: Christian Heimes <christian@python.org> Signed-off-by: Sam Sneddon <me@gsnedders.com>
1 parent b2b08cc commit 7e52b16

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

html5lib/_utils.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@
77
except ImportError:
88
from collections import Mapping
99

10-
from six import text_type
10+
from six import text_type, PY3
1111

12-
try:
13-
import xml.etree.cElementTree as default_etree
14-
except ImportError:
12+
if PY3:
1513
import xml.etree.ElementTree as default_etree
14+
else:
15+
try:
16+
import xml.etree.cElementTree as default_etree
17+
except ImportError:
18+
import xml.etree.ElementTree as default_etree
1619

1720

1821
__all__ = ["default_etree", "MethodDispatcher", "isSurrogatePair",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy