Suppress runtime warnings (#3354)
This commit is contained in:
parent
ec72448b8b
commit
ff985aee22
@ -5,6 +5,7 @@ from __future__ import annotations
|
|||||||
import asyncio
|
import asyncio
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
import platform
|
import platform
|
||||||
|
import warnings
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from datetime import UTC, datetime
|
from datetime import UTC, datetime
|
||||||
@ -192,6 +193,7 @@ def send(event: str, telemetry_enabled: bool | None = None, **kwargs):
|
|||||||
asyncio.create_task(async_send(event, telemetry_enabled, **kwargs))
|
asyncio.create_task(async_send(event, telemetry_enabled, **kwargs))
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
# If there is no event loop, send the event synchronously.
|
# If there is no event loop, send the event synchronously.
|
||||||
|
warnings.filterwarnings("ignore", category=RuntimeWarning)
|
||||||
_send(event, telemetry_enabled, **kwargs)
|
_send(event, telemetry_enabled, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user