|
|
|
@ -183,8 +183,9 @@ if PY_MAJOR_VERSION >= 3 and PY_MINOR_VERSION >= 7: |
|
|
|
|
try: |
|
|
|
|
return asyncio.get_running_loop() |
|
|
|
|
except RuntimeError: |
|
|
|
|
# Convert warnings to errors so we can capture them with except |
|
|
|
|
warnings.filterwarnings("error", category=DeprecationWarning, module=__name__) |
|
|
|
|
with warnings.catch_warnings(): |
|
|
|
|
# Convert DeprecationWarning to errors so we can capture them with except |
|
|
|
|
warnings.simplefilter("error", DeprecationWarning) |
|
|
|
|
try: |
|
|
|
|
return asyncio.get_event_loop_policy().get_event_loop() |
|
|
|
|
# Since version 3.12, DeprecationWarning is emitted if there is no |
|
|
|
|