Use _construct_response in AsyncClient._make_request
authorHarmon <Harmon758@gmail.com>
Fri, 28 Oct 2022 06:20:20 +0000 (01:20 -0500)
committerHarmon <Harmon758@gmail.com>
Fri, 28 Oct 2022 06:20:20 +0000 (01:20 -0500)
tweepy/asynchronous/client.py

index be256aea315d6077772cbafd9dda6a52fc110e8c..e0bdf3c636630334083ad051f41515216d3f5293 100644 (file)
@@ -155,16 +155,7 @@ class AsyncBaseClient(BaseClient):
         if self.return_type is dict:
             return response
 
-        data = response.get("data")
-        data = self._process_data(data, data_type=data_type)
-
-        includes = response.get("includes", {})
-        includes = self._process_includes(includes)
-
-        errors = response.get("errors", [])
-        meta = response.get("meta", {})
-
-        return Response(data, includes, errors, meta)
+        return self._construct_response(response, data_type=data_type)
 
 
 class AsyncClient(AsyncBaseClient):