Skip to content

SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]

Fix unbound variable in error handling (#32)

Kilian Lieret1adc4b3a2873
diff --git a/sweagent/environment/swe_env.py b/sweagent/environment/swe_env.py
index 9b256993..ea72e603 100644
--- a/sweagent/environment/swe_env.py
+++ b/sweagent/environment/swe_env.py
@@ -290,7 +290,7 @@ class SWEEnv(gym.Env):
logger.warning(f"Failed to execute command: {e}\nRESTARTING PROCESS.")
self.reset_container()
return observation, 0, True, info
- except BrokenPipeError:
+ except BrokenPipeError as e:
observation += "\nBROKEN PIPE ERROR. RESTARTING PROCESS."
info["exit_status"] = "early_exit"
logger.error(f"Broken pipe error: {e}\nRESTARTING PROCESS.")