Verified Commit be8b1efc authored by Sebastian Endres's avatar Sebastian Endres
Browse files

Try to fix "This event loop is already running" errors

parent eb39450e
......@@ -12,6 +12,7 @@ from functools import cached_property
from pathlib import Path
from typing import Any, Iterator, Optional, TypedDict
import nest_asyncio
import pyshark
from prompt_toolkit.formatted_text import HTML
from prompt_toolkit.shortcuts import ProgressBar
......@@ -24,6 +25,9 @@ if typing.TYPE_CHECKING:
from pyshark.packet.packet import Packet
# https://github.com/KimiNewt/pyshark/issues/434#issuecomment-691706873
nest_asyncio.apply()
QuicStreamPacket = Any
......@@ -293,6 +297,8 @@ class Trace:
packets.append(packet)
# https://github.com/KimiNewt/pyshark/issues/366#issuecomment-524746268
self._cap.close()
self._packets = packets
@staticmethod
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment