From 9557844065b284f8d4f44402eb91f1f206c1898f Mon Sep 17 00:00:00 2001 From: Filip Suster Date: Mon, 3 Aug 2020 14:36:12 +0200 Subject: [PATCH] Fix generator.py:download_to_file When some script which is using generator.py module (e.g. generate-publicdns.py) is run for the first time, the file is missing and unhandled exception is thrown --- tools/generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/generator.py b/tools/generator.py index 6a6fe1e..108286a 100644 --- a/tools/generator.py +++ b/tools/generator.py @@ -21,7 +21,7 @@ def download_to_file(url, file): if(url_datetime > file_datetime): actual_download_to_file(url, file, user_agent) - except KeyError as ex: + except (KeyError, FileNotFoundError) as ex: logging.warning(str(ex)) actual_download_to_file(url, file, user_agent)