Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3d62987

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'thave cElementTree. I'd like to bring it back with a deprecation warningto drop in 3.10.See:python/cpython#19921Signed-off-by: Christian Heimes <christian@python.org>Signed-off-by: Sam Sneddon <me@gsnedders.com>
1 parentd49afd3 commit3d62987

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
@@ -2,12 +2,15 @@
22

33
fromtypesimportModuleType
44

5-
fromsiximporttext_type
5+
fromsiximporttext_type,PY3
66

7-
try:
8-
importxml.etree.cElementTreeasdefault_etree
9-
exceptImportError:
7+
ifPY3:
108
importxml.etree.ElementTreeasdefault_etree
9+
else:
10+
try:
11+
importxml.etree.cElementTreeasdefault_etree
12+
exceptImportError:
13+
importxml.etree.ElementTreeasdefault_etree
1114

1215

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp