summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorWolfgang Müller2024-11-14 16:12:26 +0100
committerWolfgang Müller2024-11-14 16:51:34 +0100
commitb4eb3a5d37ab7f8de09ee699d4695ec0c1a54e57 (patch)
tree5c5b88949a6e07f9d1ce0e3fa0cc5603aec6fcb5 /src
parent98426ee2034c8f77ac3a1b3fc22ee68f094519b0 (diff)
downloadhircine-b4eb3a5d37ab7f8de09ee699d4695ec0c1a54e57.tar.gz
backend/scraper: Bind loop variables correctly
This was uncovered by bugbear, but did not seem to have tripped our test. Fix it anyway.
Diffstat (limited to 'src')
-rw-r--r--src/hircine/scraper/utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/hircine/scraper/utils.py b/src/hircine/scraper/utils.py
index 6afa2ed..1c1fbee 100644
--- a/src/hircine/scraper/utils.py
+++ b/src/hircine/scraper/utils.py
@@ -27,11 +27,11 @@ def parse_dict(parsers, data):
value = data[field]
if isinstance(value, list):
- yield from [lambda i=x: parser(i) for x in value]
+ yield from [lambda x=x, parser=parser: parser(x) for x in value]
elif isinstance(value, dict):
yield from parse_dict(parser, value)
else:
- yield lambda: parser(value)
+ yield lambda parser=parser, value=value: parser(value)
@contextmanager