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():
|
||||
import os, traceback
|
||||
str = traceback.format_exc()
|
||||
import os
|
||||
import traceback
|
||||
_str = traceback.format_exc()
|
||||
current_path = os.getcwd()
|
||||
replace_path = "."
|
||||
return str.replace(current_path, replace_path)
|
||||
return _str.replace(current_path, replace_path)
|
||||
|
||||
|
||||
def CatchException(f):
|
||||
@ -101,7 +102,7 @@ def CatchException(f):
|
||||
yield from f(txt, top_p, temperature, chatbot, history, systemPromptTxt, WEB_PORT)
|
||||
except Exception as e:
|
||||
from check_proxy import check_proxy
|
||||
from toolbox import get_conf
|
||||
# from toolbox import get_conf # 不需要导入本文件内容
|
||||
proxies, = get_conf('proxies')
|
||||
tb_str = '```\n' + trimmed_format_exc() + '```'
|
||||
if len(chatbot) == 0:
|
||||
|
||||
Reference in New Issue
Block a user