Skip to content

Commit c533859

Browse files
author
Kevin J Walters
committed
Removing unnecessary lambda and now re-throwing exceptions from json_transforms rather than ploughing on. #38
1 parent 206887d commit c533859

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

adafruit_pyportal.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,7 @@ def __init__(self, *, url=None, headers=None, json_path=None, regexp_path=None,
340340
if callable(json_transforms):
341341
self._json_transforms.append(json_transforms)
342342
else:
343-
self._json_transforms.extend(filter(lambda fn : callable(fn),
344-
json_transforms
345-
))
343+
self._json_transforms.extend(filter(callable, json_transforms))
346344

347345
self._image_json_path = image_json_path
348346
self._image_url_path = image_url_path
@@ -733,6 +731,7 @@ def fetch(self, refresh_url=None):
733731
json_transform(json_out)
734732
except Exception as error:
735733
print("Exception from json_transform: ", idx, error)
734+
raise
736735

737736
# extract desired text/values from json
738737
if self._json_path:

0 commit comments

Comments
 (0)