Skip to content

Commit

Permalink
Merge pull request swe-bench#122 from ALiersEL/main
Browse files Browse the repository at this point in the history
Add error handling for repo cloning
  • Loading branch information
john-b-yang authored May 21, 2024
2 parents 650c813 + c79d0f2 commit aa8c667
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions swebench/harness/context_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,10 @@ def __enter__(self):
# Clone github per repo/version
repo_path = os.path.join(self.testbed, env_name)
if not os.path.exists(repo_path):
clone_repo(repo, repo_path)
self.log.write(f"Cloned {repo} to {repo_path}")
if clone_repo(repo, repo_path):
self.log.write(f"Cloned {repo} to {repo_path}")
else:
raise Exception(f"Failed to clone {repo} to {repo_path}")
else:
self.log.write(f"Repo for {repo_prefix} version {version} exists: {repo_path}; skipping")

Expand Down

0 comments on commit aa8c667

Please sign in to comment.