+_orig_retry_request = apiclient.http._retry_request
+def _retry_request(http, num_retries, *args, **kwargs):
+ try:
+ num_retries = max(num_retries, http.num_retries)
+ except AttributeError:
+ # `http` client object does not have a `num_retries` attribute.
+ # It apparently hasn't gone through _patch_http_request, possibly
+ # because this isn't an Arvados API client. We need to continue on to
+ # avoid interfering with other Google API clients.
+ pass
+ return _orig_retry_request(http, num_retries, *args, **kwargs)
+apiclient.http._retry_request = _retry_request
+