From 4c99ca46d47307c1aa93f66cd9f7a58a1a5c2acd Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 24 Apr 2009 21:37:31 -0500 Subject: [PATCH] Oops, messed up on the error message --- src/rtm_api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rtm_api.py b/src/rtm_api.py index 720c0d2..c30b5b9 100644 --- a/src/rtm_api.py +++ b/src/rtm_api.py @@ -110,10 +110,11 @@ class RTMapi(object): time.sleep(1) chunk = connection.read() json = "".join(chunks) + if "Content-Length" in connection.info(): assert len(json) == int(connection.info()["Content-Length"]), "The packet header promised %s of data but only was able to read %s of data" % ( - len(json), connection.info()["Content-Length"], + len(json), ) data = DottedDict('ROOT', parse_json(json)) -- 1.7.9.5