Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix session close handling in command-line client #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renemarc
Copy link
Contributor

@renemarc renemarc commented Mar 26, 2020

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 on lines -4 to -5
import asyncio
import json
Copy link
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 on lines +39 to +40
def __init__(self, username, password, timeout=REQUESTS_TIMEOUT,
session=None):
Copy link
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


def get_data(self):
"""Return collected data"""
return self._data

def close_session(self):
async def close_session(self):
Copy link
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.

None yet

1 participant