1#!/usr/bin/env python3 2import logging 3import warnings 4 5try: 6 import httplib 7except ImportError: 8 import http.client 9 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 17 18class disable_warning_urllib: 19 def do_nothing(): 20 return 21