Skip to content

Commit 34073f2

Browse files
committed
snip source correctly for dep tracker
1 parent 7e0a95f commit 34073f2

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

reflex/vars/dep_tracking.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,10 @@ def _eval_var(self) -> Var:
254254
# Create a python source string snippet.
255255
if len(source) > 1:
256256
snipped_source = "".join(
257-
[
258-
*source[0][start_column:],
259-
*(source[1:-2] if len(source) > 2 else []),
260-
*source[-1][: end_column - 1],
261-
]
257+
[*source[0][start_column:], *source[1:-1], *source[-1][:end_column]]
262258
)
263259
else:
264-
snipped_source = source[0][start_column : end_column - 1]
260+
snipped_source = source[0][start_column:end_column]
265261
# Evaluate the string in the context of the function's globals and closure.
266262
return eval(f"({snipped_source})", self._get_globals(), self._get_closure())
267263

0 commit comments

Comments
 (0)