if stall_warnings:
body["stall_warnings"] = "true"
- self.task = asyncio.ensure_future(
+ self.task = asyncio.create_task(
self._connect("POST", endpoint, headers=headers, body=body or None)
)
- # Use create_task when support for Python 3.6 is dropped
+ # Use name parameter when support for Python 3.7 is dropped
return self.task
def sample(self, *, languages=None, stall_warnings=False):
if stall_warnings:
params["stall_warnings"] = "true"
- self.task = asyncio.ensure_future(
+ self.task = asyncio.create_task(
self._connect("GET", endpoint, params=params)
)
- # Use create_task when support for Python 3.6 is dropped
+ # Use name parameter when support for Python 3.7 is dropped
return self.task
def disconnect(self):