Ignore ptk warning (#5410)

Because we downgraded ptk in https://github.com/xonsh/xonsh/pull/5403

### Before

```xsh
xonsh --no-rc
# /Users/pc/.local/mamba-envs/lib/python3.12/site-packages/prompt_toolkit/application/application.py:961: DeprecationWarning: There is no current event loop
#  loop = asyncio.get_event_loop()
#@
```

### After

```xsh
xonsh --no-rc
#@
```

## For community
⬇️ **Please click the 👍 reaction instead of leaving a `+1` or 👍
comment**

---------

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Andy Kipp 2024-05-13 15:41:05 +02:00 committed by GitHub
parent fd5304fb87
commit ef578c1ca6
Failed to generate hash of commit

View file

@ -185,6 +185,14 @@ class PromptToolkitShell(BaseShell):
}
def __init__(self, **kwargs):
if not XSH.env.get("XONSH_DEBUG", False):
__import__("warnings").filterwarnings(
"ignore",
"There is no current event loop",
DeprecationWarning,
module="prompt_toolkit.application.application",
)
ptk_args = kwargs.pop("ptk_args", {})
super().__init__(**kwargs)
if ON_WINDOWS: