From 27aa05387600fffe6576df2236c188c00d346bf8 Mon Sep 17 00:00:00 2001 From: Quentin Lhoest <42851186+lhoestq@users.noreply.github.com> Date: Wed, 3 Nov 2021 10:41:07 +0100 Subject: [PATCH] fix token invalid error in CI (#3200) --- tests/hub_fixtures.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/hub_fixtures.py b/tests/hub_fixtures.py index b8b68b5bf02..c870b96d1de 100644 --- a/tests/hub_fixtures.py +++ b/tests/hub_fixtures.py @@ -44,7 +44,7 @@ def hf_private_dataset_repo_txt_data_(hf_api: HfApi, hf_token, text_file): yield repo_id try: hf_api.delete_repo(token=hf_token, name=repo_name, repo_type="dataset") - except requests.exceptions.HTTPError: + except (requests.exceptions.HTTPError, ValueError): # catch http error and token invalid error pass @@ -70,7 +70,7 @@ def hf_private_dataset_repo_zipped_txt_data_(hf_api: HfApi, hf_token, zip_csv_pa yield repo_id try: hf_api.delete_repo(token=hf_token, name=repo_name, repo_type="dataset") - except requests.exceptions.HTTPError: + except (requests.exceptions.HTTPError, ValueError): # catch http error and token invalid error pass