From aa198bc16451d84cdd01cbcea8ac407230a2db02 Mon Sep 17 00:00:00 2001 From: noO0oOo0ob <38344038+noO0oOo0ob@users.noreply.github.com> Date: Thu, 6 Jun 2024 10:41:53 +0800 Subject: [PATCH] fix event sender info (#860) Co-authored-by: noO0ob --- lyrebird/event.py | 5 +++-- lyrebird/version.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lyrebird/event.py b/lyrebird/event.py index de4ffc03..0ea3a281 100644 --- a/lyrebird/event.py +++ b/lyrebird/event.py @@ -189,6 +189,7 @@ def run(self): class EventServer(ThreadServer): async_starting = False + publish_trace_deep = 3 def __init__(self, no_start = False): super().__init__() @@ -333,9 +334,9 @@ def get_publish_message(channel, message, event_id=None): # Add event sender stack = inspect.stack() - script_path = stack[2].filename + script_path = stack[EventServer.publish_trace_deep].filename script_name = script_path[script_path.rfind('/') + 1:] - function_name = stack[2].function + function_name = stack[EventServer.publish_trace_deep].function sender_dict = { "file": script_name, "function": function_name diff --git a/lyrebird/version.py b/lyrebird/version.py index b590eb46..9a98a05a 100644 --- a/lyrebird/version.py +++ b/lyrebird/version.py @@ -1,3 +1,3 @@ -IVERSION = (3, 0, 2) +IVERSION = (3, 0, 3) VERSION = ".".join(str(i) for i in IVERSION) LYREBIRD = "Lyrebird " + VERSION