diff options
author | 2024-02-01 21:53:50 +0500 | |
---|---|---|
committer | 2024-02-09 19:55:12 +0200 | |
commit | 043cbef7cd6c6fa2ca73fbcdf6769ea21cfb5950 (patch) | |
tree | e72ba005472db05d3ae8e51f36edee0d3dac2213 | |
parent | VariableOrderWrong: Enforce skel.ebuild variable order (diff) | |
download | pkgcheck-043cbef7cd6c6fa2ca73fbcdf6769ea21cfb5950.tar.gz pkgcheck-043cbef7cd6c6fa2ca73fbcdf6769ea21cfb5950.tar.bz2 pkgcheck-043cbef7cd6c6fa2ca73fbcdf6769ea21cfb5950.zip |
addons.net: suppress urllib3 import warnings
Most notably, this includes NotOpenSSLWarning:
https://github.com/urllib3/urllib3/issues/3020#issuecomment-1785873825
Signed-off-by: Anna “CyberTailor” <cyber@sysrq.in>
Closes: https://github.com/pkgcore/pkgcheck/pull/661
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
-rw-r--r-- | src/pkgcheck/addons/net.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/pkgcheck/addons/net.py b/src/pkgcheck/addons/net.py index 6db5432d..782d74d1 100644 --- a/src/pkgcheck/addons/net.py +++ b/src/pkgcheck/addons/net.py @@ -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 |