File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -173,18 +173,10 @@ def assign_fn(
173173 # This avoids the overhead of calling eval() and creating a dict on each evaluation
174174 lambda_code = f"lambda context: ({ transformed_code } )"
175175
176- # Compile the lambda wrapper - compilation parses the code but doesn't execute it
177176 try :
177+ # Compile the code but don't execute it
178178 compiled_code = compile (lambda_code , f"Expression <{ source } >" , "eval" )
179- except SyntaxError as e :
180- # Re-raise with better context
181- raise SyntaxError (
182- f"Invalid syntax in lambda-wrapped code:\n { e } \n \n Lambda code:\n { lambda_code } \n \n Transformed code:\n { transformed_code } "
183- ) from e
184-
185- # Evaluate the lambda wrapper once to get the actual lambda function
186- # This captures all helper functions from the namespace in its closure
187- try :
179+ # Actually execute the code
188180 eval_func = eval (compiled_code , eval_namespace , {})
189181 except Exception as e :
190182 # If the error hasn't been processed by error_context decorator,
You can’t perform that action at this time.
0 commit comments