Coool2 commited on
Commit
f6a28d0
·
verified ·
1 Parent(s): 797be04

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +7 -7
agent.py CHANGED
@@ -431,13 +431,13 @@ def execute_python_code(code: str) -> str:
431
  "concurrent": __import__("concurrent"),
432
  }
433
 
434
- exec_locals = {}
435
- exec(code, safe_globals, exec_locals)
436
-
437
- if 'result' in exec_locals:
438
- return str(exec_locals['result'])
439
- else:
440
- return "Code executed successfully"
441
 
442
  except Exception as e:
443
  return f"Code execution failed: {str(e)}"
 
431
  "concurrent": __import__("concurrent"),
432
  }
433
 
434
+ exec_locals = {}
435
+ exec(code, safe_globals, exec_locals)
436
+
437
+ if 'result' in exec_locals:
438
+ return str(exec_locals['result'])
439
+ else:
440
+ return "Code executed successfully"
441
 
442
  except Exception as e:
443
  return f"Code execution failed: {str(e)}"