From 69f0a384805f3b23711cce6feb876fb616c3b437 Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Fri, 28 Aug 2020 11:23:09 -0700 Subject: [PATCH] fetch_data requires less strict json_path --- adafruit_matrixportal/network.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/adafruit_matrixportal/network.py b/adafruit_matrixportal/network.py index bf99036..841c4eb 100755 --- a/adafruit_matrixportal/network.py +++ b/adafruit_matrixportal/network.py @@ -355,7 +355,11 @@ def fetch_data( response = self.fetch(url, headers=headers, timeout=timeout) - if json_path: + if json_path is not None: + if isinstance(json_path, (list, tuple)) and ( + not json_path or not isinstance(json_path[0], (list, tuple)) + ): + json_path = (json_path,) try: gc.collect() json_out = response.json()