File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -146,14 +146,16 @@ def restart_process(path):
146146 # if gc.isenabled():
147147 # # 释放内存
148148 # gc.collect()
149- print ("前进程id:" , os .getpid (), "父进程id:" , os .getppid ())
149+ print ("当前进程id:" , os .getpid ())
150+ print ("前进程组id:" , os .getpid ())
151+ print ("父进程id:" , os .getppid ())
150152
151153 py = "python3" if (os .system ("python3 -V" ) == 0 ) else "python"
152154 sysstr = platform .system ()
153155 if sysstr == "Windows" :
154- os .system (f"taskkill /pid { os .getpgid ()} /f && { py } { path } " )
156+ os .system (f"taskkill /pid { os .getpid ()} /f && { py } { path } " )
155157 elif sysstr == "Linux" :
156- os .system (f"kill -9 { os .getpgid ()} && { py } { path } " )
158+ os .system (f"kill -9 { os .getpid ()} && { py } { path } " )
157159
158160
159161if __name__ == '__main__' :
You can’t perform that action at this time.
0 commit comments