python-bleach/de-vendor.patch

88 lines
3.2 KiB
Diff
Raw Normal View History

Index: bleach/html5lib_shim.py
===================================================================
--- bleach/html5lib_shim.py.orig
+++ bleach/html5lib_shim.py
@@ -18,44 +18,44 @@ warnings.filterwarnings(
"ignore",
message="html5lib's sanitizer is deprecated",
category=DeprecationWarning,
- module="bleach._vendor.html5lib",
+ module="html5lib",
)
-from bleach._vendor.html5lib import ( # noqa: E402 module level import not at top of file
+from html5lib import ( # noqa: E402 module level import not at top of file
HTMLParser,
getTreeWalker,
)
-from bleach._vendor.html5lib import (
+from html5lib import (
constants,
) # noqa: E402 module level import not at top of file
-from bleach._vendor.html5lib.constants import ( # noqa: E402 module level import not at top of file
+from html5lib.constants import ( # noqa: E402 module level import not at top of file
namespaces,
prefixes,
)
-from bleach._vendor.html5lib.constants import (
+from html5lib.constants import (
_ReparseException as ReparseException,
) # noqa: E402 module level import not at top of file
-from bleach._vendor.html5lib.filters.base import (
+from html5lib.filters.base import (
Filter,
) # noqa: E402 module level import not at top of file
-from bleach._vendor.html5lib.filters.sanitizer import (
+from html5lib.filters.sanitizer import (
allowed_protocols,
) # noqa: E402 module level import not at top of file
-from bleach._vendor.html5lib.filters.sanitizer import (
+from html5lib.filters.sanitizer import (
Filter as SanitizerFilter,
) # noqa: E402 module level import not at top of file
-from bleach._vendor.html5lib._inputstream import (
+from html5lib._inputstream import (
HTMLInputStream,
) # noqa: E402 module level import not at top of file
-from bleach._vendor.html5lib.serializer import (
+from html5lib.serializer import (
escape,
HTMLSerializer,
) # noqa: E402 module level import not at top of file
-from bleach._vendor.html5lib._tokenizer import (
+from html5lib._tokenizer import (
attributeMap,
HTMLTokenizer,
) # noqa: E402 module level import not at top of file
-from bleach._vendor.html5lib._trie import (
+from html5lib._trie import (
Trie,
) # noqa: E402 module level import not at top of file
Index: tests/test_clean.py
===================================================================
--- tests/test_clean.py.orig
+++ tests/test_clean.py
@@ -7,7 +7,7 @@ import pytest
from bleach import clean
from bleach.html5lib_shim import Filter
from bleach.sanitizer import Cleaner
-from bleach._vendor.html5lib.constants import rcdataElements
+from html5lib.constants import rcdataElements
def test_clean_idempotent():
Index: bleach/sanitizer.py
===================================================================
--- bleach/sanitizer.py.orig
+++ bleach/sanitizer.py
@@ -283,7 +283,7 @@ class BleachSanitizerFilter(html5lib_shi
"ignore",
message="html5lib's sanitizer is deprecated",
category=DeprecationWarning,
- module="bleach._vendor.html5lib",
+ module="html5lib",
)
return super(BleachSanitizerFilter, self).__init__(source, **kwargs)