Archived
1
0
Fork 0

Update __init__.py

This commit is contained in:
yzhh 2023-01-19 23:12:02 +08:00
parent f818d65978
commit 68243b3d24

View file

@ -38,7 +38,7 @@ async def _(msg: MessageSession):
try:
res = subprocess.check_output(
f'python {os.path.abspath("./modules/calc/calc.py")} {msg.parsed_msg["<math_expression>"]}'
, timeout=10)
, timeout=10, shell=True)
await msg.finish(f'{(msg.parsed_msg["<math_expression>"])} = {res.decode("utf-8")[:-1]}')
except subprocess.TimeoutExpired:
raise NoReportException('计算超时。')