diff options
-rw-r--r-- | doorwatch.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/doorwatch.py b/doorwatch.py index b45a1c2..cdb22fb 100644 --- a/doorwatch.py +++ b/doorwatch.py @@ -24,7 +24,10 @@ if __name__ == '__main__': if last_ref is not None: req_url += '?' + last_ref r = urllib2.urlopen(req_url, timeout=120) - data = json.loads(r.read()) + buf = r.read() + if not buf.strip(): + continue + data = json.loads(buf) except Exception: sys.excepthook(*sys.exc_info()) last_ref = None |