George Keishing | e7e9171 | 2021-09-03 11:28:44 -0500 | [diff] [blame] | 1 | #!/usr/bin/env python3 |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 2 | import logging |
| 3 | import warnings |
George Keishing | 3b7115a | 2018-08-02 10:48:17 -0500 | [diff] [blame] | 4 | try: |
| 5 | import httplib |
| 6 | except ImportError: |
| 7 | import http.client |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 8 | |
| 9 | warnings.filterwarnings("ignore") |
| 10 | |
| 11 | # Hijack the HTTP lib logger message and Log only once |
| 12 | requests_log = logging.getLogger("requests.packages.urllib3") |
| 13 | requests_log.setLevel(logging.CRITICAL) |
| 14 | requests_log.propagate = False |
| 15 | |
Gunnar Mills | 096cd56 | 2018-03-26 10:19:12 -0500 | [diff] [blame] | 16 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 17 | class disable_warning_urllib(): |
| 18 | def do_nothing(): |
| 19 | return |