From 03381c216c498aff377ed494c1b1b14e06839042 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Wed, 6 Dec 2017 09:14:53 +0800 Subject: [PATCH] [Fix]Close #620 --- vnpy/data/tq/vntq.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vnpy/data/tq/vntq.py b/vnpy/data/tq/vntq.py index 4c08390d..a123a0d8 100644 --- a/vnpy/data/tq/vntq.py +++ b/vnpy/data/tq/vntq.py @@ -211,7 +211,11 @@ class TqApi(object): def on_receive_msg(self, msg): """收到数据推送""" pack = json.loads(msg) - l = pack["data"] + + if 'data' in pack: + l = pack["data"] + else: + print u'on_receive_msg收到的数据中没有data字段,数据内容%s' %str(pack) for data in l: # 合并更新数据字典