From c8ec782adf4057965369390fd09ee84d86d597e6 Mon Sep 17 00:00:00 2001 From: Karma Riuk Date: Sat, 1 Mar 2025 15:52:01 +0100 Subject: [PATCH] forgot to save when not interrupted --- clone_repos.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clone_repos.py b/clone_repos.py index 529c3a2..49a31a5 100644 --- a/clone_repos.py +++ b/clone_repos.py @@ -330,14 +330,17 @@ def clone_repos(file: str, dest: str, force: bool =False, verbose: bool = False) if "good_repo_for_crab" in updates and updates["good_repo_for_crab"]: good_repos += 1 pbar.update(1) - except KeyboardInterrupt: + except KeyboardInterrupt as e: print("Interrupted by user, saving progress...") save_df_with_updates(df, updates_list, verbose=verbose) + raise e except Exception as e: print("An error occured, saving progress and then raising the error...") save_df_with_updates(df, updates_list, verbose=verbose) raise e + if verbose: print("Saving results...") + save_df_with_updates(df, updates_list, verbose=verbose) if __name__ == "__main__": # whtie the code to parse the arguments here