1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-21 01:36:16 +02:00

Mute consequent InsecureRequestWarning warnings

This commit is contained in:
Daniel Mach 2022-10-13 09:23:02 +02:00
parent aec503585e
commit 77beee1d4a

View File

@ -8,6 +8,7 @@ import ssl
import sys
import tempfile
import time
import warnings
import http.client
import http.cookiejar
@ -25,6 +26,10 @@ from . import oscssl
from .util.helper import decode_it
# print only the first occurrence of matching warnings, regardless of location
warnings.filterwarnings("once", category=urllib3.exceptions.InsecureRequestWarning)
class MockRequest:
"""
Mock a request object for `cookiejar.extract_cookies()`