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

Depreciation Warning from asyncio in Command and OProc _init #683

Closed
amoffat opened this issue Jun 15, 2023 Discussed in #682 · 0 comments
Closed

Depreciation Warning from asyncio in Command and OProc _init #683

amoffat opened this issue Jun 15, 2023 Discussed in #682 · 0 comments

Comments

@amoffat
Copy link
Owner

amoffat commented Jun 15, 2023

This event loop code should only run if the user is using a command's asyncio features

Discussed in #682

Originally posted by Hos73 June 14, 2023
sh package version: 2.0.4
I was checking for Depreciations in my code and stumbled across depreciations in the mentioned _inits for Command. In particular line 665 and 2398
sh.py:665: DeprecationWarning: There is no current event loop asyncio.get_event_loop()
sh.py:2398: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop()

Depreciation note from asyncio
Note In Python versions 3.10.0–3.10.8 and 3.11.0 this function (and other functions which use it implicitly) emitted a [DeprecationWarning](https://docs.python.org/3/library/exceptions.html#DeprecationWarning) if there was no running event loop, even if the current loop was set on the policy. In Python versions 3.10.9, 3.11.1 and 3.12 they emit a [DeprecationWarning](https://docs.python.org/3/library/exceptions.html#DeprecationWarning) if there is no running event loop and no current loop is set. In some future Python release this will become an error

Am I using command incorrectly by not creating an asyncio event loop? Or is this just unintended depreciations? Any assistance would be great, trying to address this as it is showing up in my pytest code outputs, thank you!

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

No branches or pull requests

1 participant