|
8 | 8 | from requests_oauthlib import OAuth2Session |
9 | 9 | from urllib3 import Retry |
10 | 10 |
|
11 | | -from commercetools.version import __version__ |
12 | 11 | from commercetools.constants import HEADER_CORRELATION_ID |
13 | 12 | from commercetools.exceptions import CommercetoolsError |
14 | 13 | from commercetools.helpers import _concurrent_retry |
15 | 14 | from commercetools.services import ServicesMixin |
16 | 15 | from commercetools.utils import BaseTokenSaver, DefaultTokenSaver, fix_token_url |
| 16 | +from commercetools.version import __version__ |
17 | 17 |
|
18 | 18 |
|
19 | 19 | class RefreshingOAuth2Session(OAuth2Session): |
@@ -88,7 +88,7 @@ def __init__( |
88 | 88 | }, |
89 | 89 | token_updater=self._save_token, |
90 | 90 | ) |
91 | | - self._http_client.headers.update({'User-Agent': self._get_user_agent()}) |
| 91 | + self._http_client.headers.update({"User-Agent": self._get_user_agent()}) |
92 | 92 |
|
93 | 93 | if not http_adapter: |
94 | 94 | # Register retry handling for Connection errors and 502, 503, 504. |
@@ -223,10 +223,15 @@ def _read_env_vars(self, config: dict) -> dict: |
223 | 223 | return config |
224 | 224 |
|
225 | 225 | def _get_user_agent(self): |
226 | | - py_version = "%d.%d" % sys.version_info[0:2] |
| 226 | + py_version = "%d.%d" % sys.version_info[0:2] |
227 | 227 | arch = platform.machine() |
228 | 228 | return "commercetools-python-sdk/%s Python/%s (%s; %s; %s)" % ( |
229 | | - __version__, py_version, sys.implementation.name, sys.platform, arch) |
| 229 | + __version__, |
| 230 | + py_version, |
| 231 | + sys.implementation.name, |
| 232 | + sys.platform, |
| 233 | + arch, |
| 234 | + ) |
230 | 235 |
|
231 | 236 |
|
232 | 237 | class Client(BaseClient, ServicesMixin): |
|
0 commit comments