mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-21 22:56:38 +01:00
set loglevel of urllib3 to WARNING by default
This commit is contained in:
parent
949f4a4fbd
commit
703bece155
1 changed files with 4 additions and 1 deletions
|
@ -20,6 +20,7 @@
|
|||
|
||||
import json
|
||||
import socket
|
||||
import logging
|
||||
|
||||
import certifi
|
||||
import urllib3
|
||||
|
@ -32,6 +33,8 @@ _CON_POOL = None
|
|||
""":type: urllib3.PoolManager"""
|
||||
CON_POOL_SIZE = 1
|
||||
|
||||
logging.getLogger('urllib3').setLevel(logging.WARNING)
|
||||
|
||||
|
||||
def _get_con_pool():
|
||||
global _CON_POOL
|
||||
|
@ -99,7 +102,7 @@ def _request_wrapper(*args, **kwargs):
|
|||
raise TimedOut()
|
||||
except urllib3.exceptions.HTTPError as error:
|
||||
# HTTPError must come last as its the base urllib3 exception class
|
||||
# TODO: do something smart here; for now just raise NetowrkError
|
||||
# TODO: do something smart here; for now just raise NetworkError
|
||||
raise NetworkError('urllib3 HTTPError {0}'.format(error))
|
||||
|
||||
if 200 <= resp.status <= 299:
|
||||
|
|
Loading…
Reference in a new issue