None Type Fix
* fix self.process None Type operation error
This commit is contained in:
parent
85ca549fab
commit
347d2f5d46
13
main.py
13
main.py
|
@ -70,10 +70,15 @@ class BlacklistImporter:
|
||||||
def process(self):
|
def process(self):
|
||||||
# init new YAML variable
|
# init new YAML variable
|
||||||
local_file = YAML(typ="safe")
|
local_file = YAML(typ="safe")
|
||||||
try:
|
|
||||||
local_file = local_file.load(open(self.outfile, "r", encoding="utf-8"))
|
# prevent None errors
|
||||||
except FileNotFoundError:
|
if self.outfile is not None:
|
||||||
pass
|
# catch FileNotFoundError on first run or file missing
|
||||||
|
try:
|
||||||
|
local_file = local_file.load(open(self.outfile, "r", encoding="utf-8"))
|
||||||
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
remote_file = {
|
remote_file = {
|
||||||
"acl": {
|
"acl": {
|
||||||
|
|
Loading…
Reference in New Issue