aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authornico wellpott <nico@magicbroccoli.de>2021-07-23 18:00:53 +0200
committernico wellpott <nico@magicbroccoli.de>2021-07-23 18:00:53 +0200
commita0ac0b2cea27cc63037a4ca3f2b45e8ad2d0c1fb (patch)
treeb0e027f8ac2bb65c4e8b7e59f7376d8dbfa16a48 /src
parentb2b44ce4c183acbebdc90b032891b7c6b1bd1b84 (diff)
fix: UnboundLocalError due to reference before assignment
* fix broken none catch
Diffstat (limited to 'src')
-rw-r--r--src/blimp/bl_process.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/blimp/bl_process.py b/src/blimp/bl_process.py
index e1b4160..6cd9bb4 100644
--- a/src/blimp/bl_process.py
+++ b/src/blimp/bl_process.py
@@ -10,20 +10,19 @@ class ProcessBlocklist:
def __init__(self):
pass
+
@classmethod
def process(self, blacklist, outfile, dryrun: bool):
"""
function to build and compare the local yaml file to the remote file
if the remote file is different, the local file gets overwritten
"""
- # cheeky none catch
try:
# load local blacklist outfile
- if local_file_present(outfile):
- with open(outfile, "r", encoding="utf-8") as local_file:
- local_blacklist = local_file.read()
+ with open(outfile, "r", encoding="utf-8") as local_file:
+ local_blacklist = local_file.read()
- except TypeError:
+ except (TypeError, FileNotFoundError):
# no local copy use empty one instead
local_blacklist = YAML(typ="safe")