Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/py/reactpy/reactpy/core/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import asyncio
from functools import lru_cache
import hashlib
import linecache
import sys
from collections.abc import Coroutine, Sequence
from hashlib import md5
Expand Down Expand Up @@ -102,8 +103,11 @@ def get_caller_info():
patch_path = render_frame.f_locals.get("patch_path_for_state")
if patch_path is not None:
break
# Extract the relevant information: file path and line number and hash it
return f"{caller_frame.f_code.co_filename} {caller_frame.f_lineno} {patch_path}"
# Extract the relevant information: file path, line number, and line and hash it
filename = caller_frame.f_code.co_filename
lineno = caller_frame.f_lineno
line = linecache.getline(filename, lineno)
return f"{filename} {lineno} {line}, {patch_path}"


__DEBUG_CALLER_INFO_TO_STATE_KEY = {}
Expand Down