diff options
| author | Abe Hanoka <abe@habet.dev> | 2025-07-11 11:59:25 -0400 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-11 08:59:25 -0700 | 
| commit | 4c53c6d1877ea748ca0a37f0dbb082277ed0bb57 (patch) | |
| tree | 05a45bc4546c4580d0df1c70903606068ec0e898 | |
| parent | 1f4f42c718a4363e2c4e22ef63bc20456612552a (diff) | |
Fix timeout type hint in RequestsClient (#1537)
The `RequestsClient`'s `__init__` method incorrectly typed the `timeout` parameter as `int`. The underlying `requests` library accepts a float for a total timeout or a `(connect_timeout, read_timeout)` tuple. This commit updates the type hint to `Union[float, Tuple[float, float]]` to accurately reflect the timeout in the requests library. https://github.com/psf/requests/blob/91a3eabd3dcc4d7f36dd8249e4777a90ef9b4305/src/requests/sessions.py#L538
| -rw-r--r-- | stripe/_http_client.py | 2 | 
1 files changed, 1 insertions, 1 deletions
| diff --git a/stripe/_http_client.py b/stripe/_http_client.py index 5a1b6981..b5421424 100644 --- a/stripe/_http_client.py +++ b/stripe/_http_client.py @@ -595,7 +595,7 @@ class RequestsClient(HTTPClient):  def __init__(  self, - timeout: int = 80, + timeout: Union[float, Tuple[float, float]] = 80,  session: Optional["RequestsSession"] = None,  verify_ssl_certs: bool = True,  proxy: Optional[Union[str, HTTPClient._Proxy]] = None, | 
