File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
+ from contextlib import contextmanager
15
16
import logging
16
17
import os
17
18
import re
@@ -150,8 +151,20 @@ def response(self, request):
150
151
return Response (request , self )
151
152
152
153
def _dispatch_async (self , request , callback ):
153
- return _do_request (self ._asyncpool , request , stream = True ,
154
- background_callback = callback )
154
+
155
+ @contextmanager
156
+ def no_futuressession_logging ():
157
+ logger = logging .getLogger ("FuturesSession" )
158
+ prev_level = logger .getEffectiveLevel ()
159
+ try :
160
+ logger .setLevel (logging .CRITICAL )
161
+ yield
162
+ finally :
163
+ logger .setLevel (prev_level )
164
+
165
+ with no_futuressession_logging ():
166
+ return _do_request (self ._asyncpool , request , stream = True ,
167
+ background_callback = callback )
155
168
156
169
def _dispatch (self , request , callback = None ):
157
170
return _do_request (self .session , request )
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ def geometry_from_json(obj):
71
71
def check_status (response ):
72
72
'''check the status of the response and if needed raise an APIException'''
73
73
status = response .status_code
74
- if status < 300 :
74
+ if status < 400 :
75
75
return
76
76
exception = {
77
77
400 : exceptions .BadQuery ,
You can’t perform that action at this time.
0 commit comments