Explorar el Código

以实际环境中json结果都是返回unicode字符,而调试结果返回的是str,两者有区别,以实际环境为主进行代码修改。

Jeff hace 3 años
padre
commit
a6c9fe2087
Se han modificado 1 ficheros con 8 adiciones y 7 borrados
  1. 8 7
      自动编译系统脚本标准化/builder.py

+ 8 - 7
自动编译系统脚本标准化/builder.py

@@ -99,13 +99,14 @@ def prev_compile():
         return False
     
     # Python无法将字符串'false'转为布尔类型;
-    print(type(PREV_ARG['sync']))
-    print(type(PREV_ARG['redownload']))
-    if type(PREV_ARG['sync']) == type('str'):
-        PREV_ARG['sync'] = True if PREV_ARG['sync'].lower() == 'true' else False
-
-    if type(PREV_ARG['redownload']) == type('str'):
-        PREV_ARG['redownload'] = True if PREV_ARG['redownload'].lower() == 'true' else False
+    if type(PREV_ARG['sync']) == type(u'str'):
+        PREV_ARG['sync'] = True if PREV_ARG['sync'].lower() == u'true' else False
+
+    if type(PREV_ARG['redownload']) == type(u'str'):
+        PREV_ARG['redownload'] = True if PREV_ARG['redownload'].lower() == u'true' else False
+			
+    print(type(PREV_ARG['sync']), PREV_ARG['sync'])
+    print(type(PREV_ARG['redownload']), PREV_ARG['redownload'])
 
     # 更新代码;
     commands=None