Skip to content

Fix session close handling in command-line client#9

Open
renemarc wants to merge 1 commit into
titilambert:masterfrom
renemarc:fix/async-session-close
Open

Fix session close handling in command-line client#9
renemarc wants to merge 1 commit into
titilambert:masterfrom
renemarc:fix/async-session-close

Conversation

@renemarc

@renemarc renemarc commented Mar 26, 2020

Copy link
Copy Markdown
Contributor

While the master branch module is working well, using the command-line client still issues the warning:

pyebox/client.py:197: RuntimeWarning: coroutine 'noop2' was never awaited
self._session._connector.close()

This PR aims to fix this by removing session-closing duties from the client and handing them over to the EboxClient class.

BREAKING CHANGE: method close_session() must now be awaited.

Comment thread pyebox/client.py
Comment on lines -4 to -5
import asyncio
import json

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opportunistic removal of unused packages

Comment thread pyebox/client.py
Comment on lines +39 to +40
def __init__(self, username, password, timeout=REQUESTS_TIMEOUT,
session=None):

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opportunistic PEP-8 line-wrap

Comment thread pyebox/client.py
return self._data

def close_session(self):
async def close_session(self):

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaking change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant