From db01651251e7bc574537d403d7459e244ef86bf5 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Sat, 7 Jan 2023 02:23:34 +0100 Subject: [PATCH] Gestito errore di verifica delle build con cartella quando non trovate. --- loaih/build.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/loaih/build.py b/loaih/build.py index adb6cb0..29218e3 100644 --- a/loaih/build.py +++ b/loaih/build.py @@ -159,14 +159,19 @@ class Build(loaih.RemoteBuild): path = str.join('/', path_arr) print(f"DEBUG - Name: {name}, URL: {path}") matching = [] - with urllib.request.urlopen(path) as url: - matching = etree.HTML(url.read()).xpath( - f"//a[contains(@href, '{name}')]/@href" - ) + try: + with urllib.request.urlopen(path) as url: + matching = etree.HTML(url.read()).xpath( + f"//a[contains(@href, '{name}')]/@href" + ) - if len(matching) > 0: - # Already built. - self.built[arch] = True + if len(matching) > 0: + # Already built. + self.built[arch] = True + + except urllib.error.HTTPError: + # The URL specified do not exist. So it is to build. + pass else: # Repo is local