修复启动器退出时 _MEI 临时目录清理弹窗
This commit is contained in:
1 parent
1e936bfb84
commit
b64de0f2a4
1 file changed
+13
@@ -381,6 +381,19 @@ def start_gmweb():
|
||||
_logf("gmweb:%d 已在监听,跳过启动" % GM_WEB_PORT)
|
||||
return
|
||||
|
||||
if getattr(sys, "frozen", False):
|
||||
# A frozen onefile launcher must not spawn itself for gmweb: the
|
||||
# child keeps the parent _MEI directory open after the window closes,
|
||||
# which makes PyInstaller report "Failed to remove temporary directory".
|
||||
_logf("gmweb: frozen mode uses in-process server")
|
||||
start_gmweb_inproc(script)
|
||||
for _ in range(30):
|
||||
if port_open(GM_WEB_PORT):
|
||||
_logf("gmweb: http://127.0.0.1:%d/ ready" % GM_WEB_PORT)
|
||||
return
|
||||
time.sleep(0.2)
|
||||
return
|
||||
|
||||
try:
|
||||
kwargs = {"cwd": os.path.dirname(script),
|
||||
"stdout": subprocess.DEVNULL,
|
||||
|
||||
Reference in new issue
Block a user