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

Commit0ba6628

Browse files
jdufresnegsnedders
authored andcommitted
Remove unnecessary compatibility shim for BytesIO (#401)
io.BytesIO is available on all supported Pythons. Can simplify byassuming the import will succeed.
1 parentfd04f6a commit0ba6628

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

‎html5lib/_inputstream.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,14 @@
55

66
importcodecs
77
importre
8+
fromioimportBytesIO,StringIO
89

910
importwebencodings
1011

1112
from .constantsimportEOF,spaceCharacters,asciiLetters,asciiUppercase
1213
from .constantsimport_ReparseException
1314
from .import_utils
1415

15-
fromioimportStringIO
16-
17-
try:
18-
fromioimportBytesIO
19-
exceptImportError:
20-
BytesIO=StringIO
21-
2216
# Non-unicode versions of constants for use in the pre-parser
2317
spaceCharactersBytes=frozenset([item.encode("ascii")foriteminspaceCharacters])
2418
asciiLettersBytes=frozenset([item.encode("ascii")foriteminasciiLetters])

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp