From ac575776aacc04deeb979f2808e7df877412317b Mon Sep 17 00:00:00 2001 From: AnzeXie Date: Wed, 25 Aug 2021 00:37:37 -0500 Subject: [PATCH] minor fix --- src/python/tools/preprocess.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/python/tools/preprocess.py b/src/python/tools/preprocess.py index 9ba01817..7b72c393 100644 --- a/src/python/tools/preprocess.py +++ b/src/python/tools/preprocess.py @@ -670,7 +670,7 @@ def download_file(url, output_dir): The path to the downloaded files. Raises: - OSError: An error occurred when downloading is failed. + RuntimeError: An error occurred when downloading is failed. """ output_dir = Path(output_dir) if not output_dir.exists(): @@ -688,7 +688,7 @@ def download_file(url, output_dir): print(f"Downloading {filename} to {filepath}") urlretrieve(url, str(filepath)) except OSError: - raise OSError(f"Failed to download {filename}") + raise RuntimeError(f"Failed to download {filename}") return filepath @@ -749,7 +749,7 @@ def extract_file(filepath): except: raise RuntimeError("Undefined exception.") except EOFError: - raise EOFError("Dataset file isn't complete. Try download again.") + raise RuntimeError("Dataset file isn't complete. Try download again.") if filepath.exists(): filepath.unlink()