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 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15+ from contextlib import contextmanager
1516import logging
1617import os
1718import re
@@ -150,8 +151,20 @@ def response(self, request):
150151 return Response (request , self )
151152
152153 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 )
155168
156169 def _dispatch (self , request , callback = None ):
157170 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):
7171def check_status (response ):
7272 '''check the status of the response and if needed raise an APIException'''
7373 status = response .status_code
74- if status < 300 :
74+ if status < 400 :
7575 return
7676 exception = {
7777 400 : exceptions .BadQuery ,
You can’t perform that action at this time.
0 commit comments