Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion html5lib/_inputstream.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
from __future__ import absolute_import, division, unicode_literals

from six import text_type
from six.moves import http_client, urllib

try:
from six.moves import http_client, urllib
except ModuleNotFoundError:
# Support for Python 3.12+ where six.moves is not available.
import http.client as http_client
import urllib

import codecs
import re
Expand Down
6 changes: 5 additions & 1 deletion html5lib/filters/sanitizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
import warnings
from xml.sax.saxutils import escape, unescape

from six.moves import urllib_parse as urlparse
try:
from six.moves import urllib_parse as urlparse
except ModuleNotFoundError:
# Support for Python 3.12+ where six.moves is not available.
import urllib.parse as urlparse

from . import base
from ..constants import namespaces, prefixes
Expand Down
8 changes: 7 additions & 1 deletion html5lib/tests/test_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@
import pytest

import six
from six.moves import http_client, urllib

try:
from six.moves import http_client, urllib
except ModuleNotFoundError:
# Support for Python 3.12+ where six.moves is not available.
import http.client as http_client
import urllib

from html5lib._inputstream import (BufferedStream, HTMLInputStream,
HTMLUnicodeInputStream, HTMLBinaryInputStream)
Expand Down