diff --git a/open_contrib_pr.py b/open_contrib_pr.py index fbc2321..7030ae2 100644 --- a/open_contrib_pr.py +++ b/open_contrib_pr.py @@ -154,7 +154,7 @@ def clone_repository(gh_actor, token, endpoint, repo): repo_name = repo["name"] try: os.system(f"git clone https://{gh_actor}:{token}@{endpoint}/{repo_full_name}") - except Exception as e: # pylint: disable=broad-exception-caught + except OSError as e: print(f"Failed to clone repository: {e}") return None return repo_name diff --git a/test_open_contrib_pr.py b/test_open_contrib_pr.py index e3f47c8..b063f48 100644 --- a/test_open_contrib_pr.py +++ b/test_open_contrib_pr.py @@ -65,7 +65,7 @@ class TestCloneRepository(unittest.TestCase): """ Test the clone_repository function when the clone fails. """ - mock_system.side_effect = Exception("Clone failed") # Simulate clone failure + mock_system.side_effect = OSError("Clone failed") # Simulate clone failure result = clone_repository( gh_actor="test_actor",