Skip to content

Commit

Permalink
"close" method is now awaitable, fix requirements-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Fahreeve committed Apr 8, 2018
1 parent 0a6f023 commit 2694690
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions aiovk/drivers.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async def post_text(self, url, data, timeout=None):
'''
raise NotImplementedError

def close(self):
async def close(self):
raise NotImplementedError


Expand Down Expand Up @@ -91,8 +91,8 @@ async def post_text(self, url, data, timeout=None):
async with self.session.post(url, data=data, timeout=timeout or self.timeout) as response:
return response.url, await response.text()

def close(self):
self.session.close()
async def close(self):
await self.session.close()


if ProxyConnector is not None:
Expand Down
4 changes: 2 additions & 2 deletions aiovk/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ async def get_bin(self, *args, **kwargs):
async def post_text(self, *args, **kwargs):
return await super().post_text(*args, **kwargs)

def close(self):
super().close()
async def close(self):
await super().close()
self._queue.canel()


Expand Down
4 changes: 2 additions & 2 deletions aiovk/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ async def __aenter__(self):

async def __aexit__(self, exc_type, exc_val, exc_tb):
"""Closes session after usage of context manager with Session"""
self.close()
await self.close()

def close(self) -> None:
async def close(self) -> None:
"""Perform the actions associated with the completion of the current session"""

@abstractmethod
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-r requirements.txt
aio.testing==0.1.0
aiounittest-1.1.0
aiounittest==1.1.0
pyotp==2.2.6

0 comments on commit 2694690

Please sign in to comment.