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

Fix collections imports for Python 3.8#408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
labrys wants to merge1 commit intohtml5lib:masterfromlabrys:fix/collections
Closed
Show file tree
Hide file tree
Changes fromall 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
7 changes: 5 additions & 2 deletionshtml5lib/_tokenizer.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,8 +2,6 @@

from six import unichr as chr

from collections import deque

from .constants import spaceCharacters
from .constants import entities
from .constants import asciiLetters, asciiUpper2Lower
Expand All@@ -15,6 +13,11 @@

from ._trie import Trie

try:
from collections.abc import deque
except ImportError:
from collections import deque

entitiesTrie = Trie(entities)


Expand Down
5 changes: 4 additions & 1 deletionhtml5lib/filters/alphabeticalattributes.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,10 @@

from . import base

from collections import OrderedDict
try:
from collections.abc import OrderedDict
except ImportError:
from collections import OrderedDict


def _attr_key(attr):
Expand Down
6 changes: 5 additions & 1 deletionhtml5lib/html5parser.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,6 @@
from six import with_metaclass, viewkeys

import types
from collections import OrderedDict

from . import _inputstream
from . import _tokenizer
Expand All@@ -23,6 +22,11 @@
_ReparseException
)

try:
from collections.abc import OrderedDict
except ImportError:
from collections import OrderedDict


def parse(doc, treebuilder="etree", namespaceHTMLElements=True, **kwargs):
"""Parse an HTML document as a string or file-like object into a tree
Expand Down
7 changes: 5 additions & 2 deletionshtml5lib/tests/test_alphabeticalattributes.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
from __future__ import absolute_import, division, unicode_literals

from collections import OrderedDict

import pytest

import html5lib
from html5lib.filters.alphabeticalattributes import Filter
from html5lib.serializer import HTMLSerializer

try:
from collections.abc import OrderedDict
except ImportError:
from collections import OrderedDict


@pytest.mark.parametrize('msg, attrs, expected_attrs', [
(
Expand Down
6 changes: 5 additions & 1 deletionhtml5lib/treewalkers/etree.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
from __future__ import absolute_import, division, unicode_literals

from collections import OrderedDict
import re

from six import string_types

from . import base
from .._utils import moduleFactoryFactory

try:
from collections.abc import OrderedDict
except ImportError:
from collections import OrderedDict

tag_regexp = re.compile("{([^}]*)}(.*)")


Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp