From e4203575f53f8b32391b4c9bbffd988faef3b985 Mon Sep 17 00:00:00 2001 From: "physikerwelt (Moritz Schubotz)" Date: Thu, 2 Sep 2021 23:09:20 +0200 Subject: [PATCH] Minor: Move variables used in error message into scope --- src/update_zblinks_api/update_with_api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/update_zblinks_api/update_with_api.py b/src/update_zblinks_api/update_with_api.py index 227fad7..da83871 100644 --- a/src/update_zblinks_api/update_with_api.py +++ b/src/update_zblinks_api/update_with_api.py @@ -291,16 +291,16 @@ def use_files_to_update(): except FileNotFoundError: click.echo(f"Error: could not find {insert_file}.") + edit_file = f"results/{partner}_to_edit.csv" try: - edit_file = f"results/{partner}_to_edit.csv" df_edit = pd.read_csv(edit_file) for _, row in df_edit.iterrows(): update_request(row, partner) except FileNotFoundError: click.echo(f"Error: could not find {edit_file}.") + delete_file = f"results/{partner}_delete_links.csv" try: - delete_file = f"results/{partner}_delete_links.csv" df_delete = pd.read_csv(delete_file) for _, row in df_delete.iterrows(): delete_request(row, partner)