From d9a06c11cdb9595c7aa5278be32c080361fe79fa Mon Sep 17 00:00:00 2001 From: msincenselee Date: Sun, 2 Feb 2020 19:05:09 +0800 Subject: [PATCH] [bug fix] --- vnpy/trader/util_wechat.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/vnpy/trader/util_wechat.py b/vnpy/trader/util_wechat.py index e0557ca3..402974fd 100644 --- a/vnpy/trader/util_wechat.py +++ b/vnpy/trader/util_wechat.py @@ -11,10 +11,8 @@ http://wxpusher.zjiecode.com/ from threading import Lock, Thread import requests -import json import sys import traceback -from urllib.parse import urlencode from datetime import datetime global wechat_lock @@ -58,7 +56,7 @@ class wechat_thread(Thread): try: response = requests.post(self.request_url, json=params).json() if not response.get('success', False): - print(response) + print(response) except Exception as e: print("{} wechat_thread sent failed! ex:{},trace:{}".format(datetime.now(), str(e), traceback.format_exc()), file=sys.stderr) @@ -74,7 +72,7 @@ def send_wx_msg(content=''): :return: """ - if len(text) == 0: + if len(content) == 0: return t = wechat_thread(uid=UID, content=content)