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

Commit7e52b16

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 parentb2b08cc commit7e52b16

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
exceptImportError:
88
fromcollectionsimportMapping
99

10-
fromsiximporttext_type
10+
fromsiximporttext_type,PY3
1111

12-
try:
13-
importxml.etree.cElementTreeasdefault_etree
14-
exceptImportError:
12+
ifPY3:
1513
importxml.etree.ElementTreeasdefault_etree
14+
else:
15+
try:
16+
importxml.etree.cElementTreeasdefault_etree
17+
exceptImportError:
18+
importxml.etree.ElementTreeasdefault_etree
1619

1720

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp