-
Notifications
You must be signed in to change notification settings - Fork 22
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
provide a fix for asyncio on Windows + Python pre-3.8 #105
Conversation
+ test + enable github actions test run on Python 3.9
…on supported on github actions
yapapi/__init__.py
Outdated
if sys.platform == "win32": | ||
|
||
class _WindowsEventPolicy(asyncio.events.BaseDefaultEventLoopPolicy): | ||
_loop_factory = asyncio.windows_events.ProactorEventLoop | ||
|
||
asyncio.set_event_loop_policy(_WindowsEventPolicy()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd just move those statements to the module level, outside any function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then I'd need more "if sys.platform" etc since this class is not valid under non-Windows platforms ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, unless you mean the same as above - then, again, I'm unsure if this is a good idea to force that upon people ...
fixes: #93