From 02d1735bb116f3a889244c5ffb44050f6e52eeb7 Mon Sep 17 00:00:00 2001 From: Bian Jiang Date: Fri, 29 Apr 2016 13:42:29 +0800 Subject: [PATCH] fix vtFunction --- vn.trader/vtFunction.py | 4 ---- vn.trader/vtMain.py | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vn.trader/vtFunction.py b/vn.trader/vtFunction.py index 8ad23936..708de59e 100644 --- a/vn.trader/vtFunction.py +++ b/vn.trader/vtFunction.py @@ -6,7 +6,6 @@ import decimal import json -import sys MAX_NUMBER = 10000000000000 MAX_DECIMAL = 4 @@ -25,9 +24,6 @@ def safeUnicode(value): if abs(d.as_tuple().exponent) > MAX_DECIMAL: value = round(value, ndigits=MAX_DECIMAL) - # Reload sys, Set default encode to UTF8 - reload(sys) - sys.setdefaultencoding('utf8') return unicode(value) #---------------------------------------------------------------------- diff --git a/vn.trader/vtMain.py b/vn.trader/vtMain.py index d0c909e0..554b1fd7 100644 --- a/vn.trader/vtMain.py +++ b/vn.trader/vtMain.py @@ -14,6 +14,10 @@ def main(): if platform.uname() == 'Windows': ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID('vn.py demo') + # Reload sys, Set default encode to UTF8 + reload(sys) + sys.setdefaultencoding('utf8') + # 初始化Qt应用对象 app = QtGui.QApplication(sys.argv) app.setWindowIcon(QtGui.QIcon('vnpy.ico'))