Skip to content

Commit 5393dbe

Browse files
authored
Fix typing of the get_meta_refresh() result (#211)
Also bump mypy and remove --show-error-codes from tox.ini as it's already in mypy.ini.
1 parent 040ec51 commit 5393dbe

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ basepython = python3
2727
deps =
2828
# mypy would error if pytest (or its sub) not found
2929
pytest
30-
mypy==0.991
30+
mypy==1.0.0
3131
commands =
32-
mypy --strict --show-error-codes {posargs: w3lib tests}
32+
mypy --strict {posargs: w3lib tests}
3333

3434
[testenv:flake8]
3535
basepython = python3

w3lib/html.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,8 @@ def get_meta_refresh(
328328
baseurl: str = "",
329329
encoding: str = "utf-8",
330330
ignore_tags: Iterable[str] = ("script", "noscript"),
331-
) -> Tuple[Optional[float], Optional[str]]:
332-
"""Return the http-equiv parameter of the HTML meta element from the given
331+
) -> Union[Tuple[None, None], Tuple[float, str]]:
332+
"""Return the http-equiv parameter of the HTML meta element from the given
333333
HTML text and return a tuple ``(interval, url)`` where interval is an integer
334334
containing the delay in seconds (or zero if not present) and url is a
335335
string with the absolute url to redirect.

0 commit comments

Comments
 (0)