Skip to content

Commit

Permalink
Fix typing of the get_meta_refresh() result (#211)
Browse files Browse the repository at this point in the history
Also bump mypy and remove --show-error-codes from tox.ini as it's already in 
mypy.ini.
  • Loading branch information
wRAR authored Feb 15, 2023
1 parent 040ec51 commit 5393dbe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ basepython = python3
deps =
# mypy would error if pytest (or its sub) not found
pytest
mypy==0.991
mypy==1.0.0
commands =
mypy --strict --show-error-codes {posargs: w3lib tests}
mypy --strict {posargs: w3lib tests}

[testenv:flake8]
basepython = python3
Expand Down
4 changes: 2 additions & 2 deletions w3lib/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,8 @@ def get_meta_refresh(
baseurl: str = "",
encoding: str = "utf-8",
ignore_tags: Iterable[str] = ("script", "noscript"),
) -> Tuple[Optional[float], Optional[str]]:
"""Return the http-equiv parameter of the HTML meta element from the given
) -> Union[Tuple[None, None], Tuple[float, str]]:
"""Return the http-equiv parameter of the HTML meta element from the given
HTML text and return a tuple ``(interval, url)`` where interval is an integer
containing the delay in seconds (or zero if not present) and url is a
string with the absolute url to redirect.
Expand Down

0 comments on commit 5393dbe

Please sign in to comment.