Skip to content

Commit

Permalink
Reuse code from _infra
Browse files Browse the repository at this point in the history
  • Loading branch information
Gallaecio committed Nov 29, 2022
1 parent 0ebe6ae commit 49663a1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions w3lib/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
from urllib.request import pathname2url, url2pathname

from .util import to_unicode
from ._infra import _ASCII_TAB_OR_NEWLINE, _C0_CONTROL_OR_SPACE
from ._types import AnyUnicodeError, StrOrBytes
from ._url import _SPECIAL_SCHEMES

Expand Down Expand Up @@ -77,9 +78,6 @@ def _quote_byte(error: UnicodeError) -> Tuple[str, int]:
_FRAGMENT_SAFEST_CHARS = _PATH_SAFEST_CHARS


_ASCII_TAB_OR_NEWLINE = "\t\n\r"
_C0_CONTROL = "".join(chr(n) for n in range(32))
_C0_CONTROL_OR_SPACE = _C0_CONTROL + " "
_ASCII_TAB_OR_NEWLINE_TRANSLATION_TABLE = {
ord(char): None for char in _ASCII_TAB_OR_NEWLINE
}
Expand Down

0 comments on commit 49663a1

Please sign in to comment.