Skip to content

Commit 9c43337

Browse files
committed
Ensure consistent types on RestSession variables
Add conversion functions to ensure the types of RestSession’s attributes are consistent.
1 parent c193c16 commit 9c43337

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ciscosparkapi/restsession.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737

3838

3939
# Module Constants
40-
DEFAULT_SINGLE_REQUEST_TIMEOUT = 20
41-
DEFAULT_RATE_LIMIT_TIMEOUT = 60
40+
DEFAULT_SINGLE_REQUEST_TIMEOUT = 20.0
41+
DEFAULT_RATE_LIMIT_TIMEOUT = 60.0
4242
RATE_LIMIT_EXCEEDED_RESPONSE_CODE = 429
4343

4444

@@ -96,9 +96,9 @@ def __init__(self, access_token, base_url, timeout=None,
9696

9797
# Initialize attributes and properties
9898
self._base_url = str(validate_base_url(base_url))
99-
self._access_token = access_token
100-
self._single_request_timeout = single_request_timeout
101-
self._rate_limit_timeout = rate_limit_timeout
99+
self._access_token = str(access_token)
100+
self._single_request_timeout = float(single_request_timeout)
101+
self._rate_limit_timeout = float(rate_limit_timeout)
102102
if timeout:
103103
self.timeout = timeout
104104

@@ -144,7 +144,7 @@ def timeout(self, value):
144144
"the 'single_request_timeout' instead.",
145145
DeprecationWarning)
146146
assert value is None or value > 0
147-
self._single_request_timeout = value
147+
self._single_request_timeout = float(value)
148148

149149
@property
150150
def single_request_timeout(self):

0 commit comments

Comments
 (0)