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

Commitfd04f6a

Browse files
jdufresnegsnedders
authored andcommitted
Remove unnecessary use of six.binary_type (#400)
The bytes type is available on all support Pythons. On Python 2 it is analias of str (same as six). Reduce unnecessary compatibility shims andby using modern Python idioms. Makes the code more forward compatiblewith Python 3.
1 parent7facf98 commitfd04f6a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎html5lib/_inputstream.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__importabsolute_import,division,unicode_literals
22

3-
fromsiximporttext_type,binary_type
3+
fromsiximporttext_type
44
fromsix.movesimporthttp_client,urllib
55

66
importcodecs
@@ -908,7 +908,7 @@ def parse(self):
908908
deflookupEncoding(encoding):
909909
"""Return the python codec name corresponding to an encoding or None if the
910910
string doesn't correspond to a valid encoding."""
911-
ifisinstance(encoding,binary_type):
911+
ifisinstance(encoding,bytes):
912912
try:
913913
encoding=encoding.decode("ascii")
914914
exceptUnicodeDecodeError:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp