Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit 2e64a1c

Browse files
fix: fix the mypy.py
Signed-off-by: Radhika Agrawal <agrawalradhika@google.com>
1 parent af21156 commit 2e64a1c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

google/auth/aio/transport/sessions.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,15 @@ async def request(
247247
self._auth_request, method, url, headers
248248
)
249249
)
250+
# Narrow the type: if it's an aiohttp.ClientTimeout, extract the float 'total'
251+
timeout_float = timeout.total if hasattr(timeout, "total") else timeout
250252
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
251253
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
252254
async for _ in retries: # pragma: no branch
253255
response = await with_timeout(
254-
self._auth_request(url, method, data, headers, timeout, **kwargs)
256+
self._auth_request(
257+
url, method, data, headers, timeout_float, **kwargs
258+
)
255259
)
256260
if response.status_code not in transport.DEFAULT_RETRYABLE_STATUS_CODES:
257261
break

0 commit comments

Comments
 (0)