Skip to content

Commit

Permalink
mypy: deal with urllib3
Browse files Browse the repository at this point in the history
  • Loading branch information
adbar committed Mar 7, 2023
1 parent 4b3d789 commit 23e415c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
- name: Type checking with mypy
if: ${{ matrix.python-version != 'pypy3.8' }}
run: |
python -m pip install --upgrade mypy
python -m pip install --upgrade mypy types-urllib3
mypy -p courlan
- name: Test with pytest
Expand Down
4 changes: 2 additions & 2 deletions courlan/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import logging

import urllib3 # type: ignore
import urllib3


LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -38,7 +38,7 @@ def redirection_test(url: str) -> str:
# "User-Agent" : str(sample(settings.USER_AGENTS, 1)), # select a random user agent
# })
try:
rhead = HTTP_POOL.request("HEAD", url)
rhead = HTTP_POOL.request("HEAD", url) # type:ignore[no-untyped-call]
except Exception as err:
LOGGER.exception("unknown error: %s %s", url, err)
else:
Expand Down

0 comments on commit 23e415c

Please sign in to comment.