aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna “CyberTailor” <cyber@sysrq.in>2024-02-01 21:53:50 +0500
committerArthur Zamarin <arthurzam@gentoo.org>2024-02-09 19:55:12 +0200
commit043cbef7cd6c6fa2ca73fbcdf6769ea21cfb5950 (patch)
treee72ba005472db05d3ae8e51f36edee0d3dac2213
parentVariableOrderWrong: Enforce skel.ebuild variable order (diff)
downloadpkgcheck-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.py8
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