Skip to content

Commit

Permalink
addons.net: suppress urllib3 import warnings
Browse files Browse the repository at this point in the history
Most notably, this includes NotOpenSSLWarning:
urllib3/urllib3#3020 (comment)

Signed-off-by: Anna “CyberTailor” <[email protected]>
Closes: #661
Signed-off-by: Arthur Zamarin <[email protected]>
  • Loading branch information
CyberTailor authored and arthurzam committed Feb 9, 2024
1 parent 7498b68 commit 043cbef
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/pkgcheck/addons/net.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

import logging
import os

import requests
import warnings

from ..checks.network import RequestError, SSLError

# suppress all urllib3 log messages
# suppress all urllib3 log messages and import warnings
with warnings.catch_warnings():
warnings.simplefilter("ignore")
import requests
logging.getLogger("urllib3").propagate = False


Expand Down

0 comments on commit 043cbef

Please sign in to comment.