ossapi 3.1.4__tar.gz → 3.1.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ossapi-3.1.4 → ossapi-3.1.6}/PKG-INFO +1 -1
- {ossapi-3.1.4 → ossapi-3.1.6}/ossapi/ossapiv2_async.py +14 -12
- {ossapi-3.1.4 → ossapi-3.1.6}/ossapi.egg-info/PKG-INFO +1 -1
- {ossapi-3.1.4 → ossapi-3.1.6}/pyproject.toml +1 -1
- {ossapi-3.1.4 → ossapi-3.1.6}/LICENSE +0 -0
- {ossapi-3.1.4 → ossapi-3.1.6}/README.md +0 -0
- {ossapi-3.1.4 → ossapi-3.1.6}/ossapi/__init__.py +0 -0
- {ossapi-3.1.4 → ossapi-3.1.6}/ossapi/encoder.py +0 -0
- {ossapi-3.1.4 → ossapi-3.1.6}/ossapi/enums.py +0 -0
- {ossapi-3.1.4 → ossapi-3.1.6}/ossapi/mod.py +0 -0
- {ossapi-3.1.4 → ossapi-3.1.6}/ossapi/models.py +0 -0
- {ossapi-3.1.4 → ossapi-3.1.6}/ossapi/ossapi.py +0 -0
- {ossapi-3.1.4 → ossapi-3.1.6}/ossapi/ossapiv2.py +0 -0
- {ossapi-3.1.4 → ossapi-3.1.6}/ossapi/replay.py +0 -0
- {ossapi-3.1.4 → ossapi-3.1.6}/ossapi/utils.py +0 -0
- {ossapi-3.1.4 → ossapi-3.1.6}/ossapi.egg-info/SOURCES.txt +0 -0
- {ossapi-3.1.4 → ossapi-3.1.6}/ossapi.egg-info/dependency_links.txt +0 -0
- {ossapi-3.1.4 → ossapi-3.1.6}/ossapi.egg-info/requires.txt +0 -0
- {ossapi-3.1.4 → ossapi-3.1.6}/ossapi.egg-info/top_level.txt +0 -0
- {ossapi-3.1.4 → ossapi-3.1.6}/setup.cfg +0 -0
- {ossapi-3.1.4 → ossapi-3.1.6}/tests/__init__.py +0 -0
- {ossapi-3.1.4 → ossapi-3.1.6}/tests/test_cursor.py +0 -0
- {ossapi-3.1.4 → ossapi-3.1.6}/tests/test_endpoints.py +0 -0
- {ossapi-3.1.4 → ossapi-3.1.6}/tests/test_models.py +0 -0
- {ossapi-3.1.4 → ossapi-3.1.6}/tests/test_v1.py +0 -0
|
@@ -108,14 +108,9 @@ class Oauth2SessionAsync(OAuth2Session):
|
|
|
108
108
|
else:
|
|
109
109
|
raise
|
|
110
110
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
# use ossapi.
|
|
115
|
-
async with aiohttp.ClientSession() as session:
|
|
116
|
-
return await session.request(
|
|
117
|
-
method, url, headers=headers, data=data, **kwargs
|
|
118
|
-
)
|
|
111
|
+
return await session.request(
|
|
112
|
+
method, url, headers=headers, data=data, **kwargs
|
|
113
|
+
)
|
|
119
114
|
|
|
120
115
|
# our `request` function below relies on the ordering of these types. The
|
|
121
116
|
# base type must come first, with any auxiliary types that the base type accepts
|
|
@@ -606,15 +601,22 @@ class OssapiAsync:
|
|
|
606
601
|
f"{self.BASE_URL}{url}", session=aiohttp_session,
|
|
607
602
|
params=params, data=data)
|
|
608
603
|
|
|
609
|
-
|
|
604
|
+
# aiohttp annoyingly differentiates between url (no url fragments, for
|
|
605
|
+
# some reason) and real_url (actual url). They also use a URL object
|
|
606
|
+
# here instead of a string.
|
|
607
|
+
url = str(r.real_url)
|
|
608
|
+
self.log.info(f"made {method} request to {url}, data {data}")
|
|
610
609
|
json_ = await r.json()
|
|
611
|
-
self.log.debug(f"received json: \n{json.dumps(json_, indent=4)}")
|
|
612
|
-
self._check_response(json_, r.url)
|
|
613
|
-
|
|
614
610
|
# aiohttp sessions have to live as long as any responses returned via
|
|
615
611
|
# the session. Wait to close it until we're done with the response `r`.
|
|
612
|
+
# Make sure we close this before we call _check_response, or any errors
|
|
613
|
+
# there will result in the session not being closed. We should probably
|
|
614
|
+
# move this to a try/finally block at some point for safety.
|
|
616
615
|
await aiohttp_session.close()
|
|
617
616
|
|
|
617
|
+
self.log.debug(f"received json: \n{json.dumps(json_, indent=4)}")
|
|
618
|
+
self._check_response(json_, url)
|
|
619
|
+
|
|
618
620
|
return self._instantiate_type(type_, json_)
|
|
619
621
|
|
|
620
622
|
def _check_response(self, json_, url):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|