Skip to content

Commit 703bece

Browse files
committed
set loglevel of urllib3 to WARNING by default
1 parent 949f4a4 commit 703bece

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

telegram/utils/request.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import json
2222
import socket
23+
import logging
2324

2425
import certifi
2526
import urllib3
@@ -32,6 +33,8 @@
3233
""":type: urllib3.PoolManager"""
3334
CON_POOL_SIZE = 1
3435

36+
logging.getLogger('urllib3').setLevel(logging.WARNING)
37+
3538

3639
def _get_con_pool():
3740
global _CON_POOL
@@ -99,7 +102,7 @@ def _request_wrapper(*args, **kwargs):
99102
raise TimedOut()
100103
except urllib3.exceptions.HTTPError as error:
101104
# HTTPError must come last as its the base urllib3 exception class
102-
# TODO: do something smart here; for now just raise NetowrkError
105+
# TODO: do something smart here; for now just raise NetworkError
103106
raise NetworkError('urllib3 HTTPError {0}'.format(error))
104107

105108
if 200 <= resp.status <= 299:

0 commit comments

Comments
 (0)