Str is a built-in type and cannot be used directly as a variable name
This commit is contained in:
@ -84,11 +84,12 @@ def update_ui_lastest_msg(lastmsg, chatbot, history, delay=1): # 刷新界面
|
|||||||
|
|
||||||
|
|
||||||
def trimmed_format_exc():
|
def trimmed_format_exc():
|
||||||
import os, traceback
|
import os
|
||||||
str = traceback.format_exc()
|
import traceback
|
||||||
|
_str = traceback.format_exc()
|
||||||
current_path = os.getcwd()
|
current_path = os.getcwd()
|
||||||
replace_path = "."
|
replace_path = "."
|
||||||
return str.replace(current_path, replace_path)
|
return _str.replace(current_path, replace_path)
|
||||||
|
|
||||||
|
|
||||||
def CatchException(f):
|
def CatchException(f):
|
||||||
@ -101,7 +102,7 @@ def CatchException(f):
|
|||||||
yield from f(txt, top_p, temperature, chatbot, history, systemPromptTxt, WEB_PORT)
|
yield from f(txt, top_p, temperature, chatbot, history, systemPromptTxt, WEB_PORT)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
from check_proxy import check_proxy
|
from check_proxy import check_proxy
|
||||||
from toolbox import get_conf
|
# from toolbox import get_conf # 不需要导入本文件内容
|
||||||
proxies, = get_conf('proxies')
|
proxies, = get_conf('proxies')
|
||||||
tb_str = '```\n' + trimmed_format_exc() + '```'
|
tb_str = '```\n' + trimmed_format_exc() + '```'
|
||||||
if len(chatbot) == 0:
|
if len(chatbot) == 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user