From cf734955dea9b7af04c33917b95d720abc9decbc Mon Sep 17 00:00:00 2001 From: ll Date: Tue, 13 Jul 2021 01:03:18 +0800 Subject: [PATCH] =?UTF-8?q?pyefun=E9=85=8D=E5=90=88=E6=98=93=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E8=A7=86=E7=AA=97=E7=BC=96=E7=A8=8B=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyefun/__init__.py | 2 +- pyefun/compile/compile.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pyefun/__init__.py b/pyefun/__init__.py index 5163f3c..ce8e142 100644 --- a/pyefun/__init__.py +++ b/pyefun/__init__.py @@ -31,4 +31,4 @@ # from pyefun.encoding.ebase64.ebase64 import * # from pyefun.encoding.url.url import * -__version__ = '1.0.27' \ No newline at end of file +__version__ = '1.0.28' \ No newline at end of file diff --git a/pyefun/compile/compile.py b/pyefun/compile/compile.py index ce5ff72..6ac209b 100644 --- a/pyefun/compile/compile.py +++ b/pyefun/compile/compile.py @@ -54,9 +54,10 @@ def 结束进程和子进程(pid): 日志.输出("kill parent proc: {} failed".format(parent_process.name)) -def 运行命令(cmd, 输出=False, 环境变量PATH="", timeout=120): +def 运行命令(cmd, 输出=False, 环境变量PATH="", timeout=120, cwd=""): global pid - + if (cwd == ""): + cwd = efun.路径优化(efun.取运行目录() + "/bulidLib") my_env = os.environ.copy() if 环境变量PATH == "": 环境变量PATH = 编译器配置.默认编译器路径 @@ -69,7 +70,7 @@ def 运行命令(cmd, 输出=False, 环境变量PATH="", timeout=120): stdin=subprocess.PIPE, env=my_env, close_fds=True, - cwd=efun.路径优化(efun.取运行目录() + "/bulidLib") + cwd=cwd ) 日志.输出(cmd) pid = proc.pid @@ -169,7 +170,7 @@ def 运行设计好的文件(文件路径): filename=文件路径, ) 日志.输出("运行 {}".format(cmd)) - ret = 运行命令(cmd, True) + ret = 运行命令(cmd, True, cwd=efun.文件_取目录(文件路径)) 日志.输出("运行完毕 {}".format(cmd))