blob: 8527b6dc35511cd2f6bc5b10e1433cf0a35db312 [file] [log] [blame]
George Keishinge7e91712021-09-03 11:28:44 -05001#!/usr/bin/env python3
Chris Austenb29d2e82016-06-07 12:25:35 -05002import logging
3import warnings
Patrick Williams20f38712022-12-08 06:18:26 -06004
George Keishing3b7115a2018-08-02 10:48:17 -05005try:
6 import httplib
7except ImportError:
8 import http.client
Chris Austenb29d2e82016-06-07 12:25:35 -05009
10warnings.filterwarnings("ignore")
11
12# Hijack the HTTP lib logger message and Log only once
13requests_log = logging.getLogger("requests.packages.urllib3")
14requests_log.setLevel(logging.CRITICAL)
15requests_log.propagate = False
16
Gunnar Mills096cd562018-03-26 10:19:12 -050017
Patrick Williams20f38712022-12-08 06:18:26 -060018class disable_warning_urllib:
Chris Austenb29d2e82016-06-07 12:25:35 -050019 def do_nothing():
20 return