Skip to content

Commit 0ba6628

Browse files
jdufresnegsnedders
authored andcommitted
Remove unnecessary compatibility shim for BytesIO (html5lib#401)
io.BytesIO is available on all supported Pythons. Can simplify by assuming the import will succeed.
1 parent fd04f6a commit 0ba6628

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
import codecs
77
import re
8+
from io import BytesIO, StringIO
89

910
import webencodings
1011

1112
from .constants import EOF, spaceCharacters, asciiLetters, asciiUppercase
1213
from .constants import _ReparseException
1314
from . import _utils
1415

15-
from io import StringIO
16-
17-
try:
18-
from io import BytesIO
19-
except ImportError:
20-
BytesIO = StringIO
21-
2216
# Non-unicode versions of constants for use in the pre-parser
2317
spaceCharactersBytes = frozenset([item.encode("ascii") for item in spaceCharacters])
2418
asciiLettersBytes = frozenset([item.encode("ascii") for item in asciiLetters])

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy