Skip to content

Commit 1b4ef52

Browse files
committed
add vpn-ip-lookups (fix #9)
1 parent 263324a commit 1b4ef52

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/riskdb/builder/enrich_data.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,18 @@ def load_lookup_lists() -> dict:
8787

8888
# creation of these files has yet to be automated
8989
for k, v in KIND_FILES.items():
90+
lookup_lists[k] = []
9091
if not Path(v).is_file():
9192
log(f'WARN: Failed to load lookup-list of kind {k}')
92-
lookup_lists[k] = []
9393
continue
9494

9595
with open(v, 'r', encoding='utf-8') as f:
96-
lookup_lists[k] = [int(l.strip()) for l in f.readlines()]
96+
for l in f.readlines():
97+
try:
98+
lookup_lists[k].append(int(l.strip()))
99+
100+
except ValueError:
101+
continue
97102

98103
return lookup_lists
99104

0 commit comments

Comments
 (0)