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

Commit0941326

Browse files
committed
Fix DATrie support under Python 2.
This is a simple issue of using `str` to refer to what should be`six.text_type`.
1 parentffa00dd commit0941326

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎html5lib/trie/datrie.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
fromitertoolsimportchain
44

55
fromdatrieimportTrieasDATrie
6+
fromsiximporttext_type
67

78
from ._baseimportTrieasABCTrie
89

910
classTrie(ABCTrie):
1011
def__init__(self,data):
1112
chars=set()
1213
forkeyindata.keys():
13-
ifnotisinstance(key,str):
14+
ifnotisinstance(key,text_type):
1415
raiseTypeError("All keys must be strings")
1516
forcharinkey:
1617
chars.add(char)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp