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

[qob] fix use of nest_asycnio #12413

Merged
merged 2 commits into from
Nov 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions hail/python/hail/__init__.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
from typing import Optional
import pkg_resources
import sys
import asyncio
import nest_asyncio
nest_asyncio.apply()

from typing import Optional # noqa: E402
import pkg_resources # noqa: E402
import sys # noqa: E402

if sys.version_info < (3, 6):
raise EnvironmentError('Hail requires Python 3.6 or later, found {}.{}'.format(
sys.version_info.major, sys.version_info.minor))

if sys.version_info[:2] == (3, 6):
if asyncio._get_running_loop() is not None:
nest_asyncio.apply()
else:
try:
asyncio.get_running_loop()
nest_asyncio.apply()
except RuntimeError as err:
assert 'no running event loop' in err.args[0]


__pip_version__ = pkg_resources.resource_string(__name__, 'hail_pip_version').decode().strip()
del pkg_resources
Expand Down