File tree 1 file changed +7
-5
lines changed 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -109,14 +109,16 @@ def process_running(pid):
109
109
def process_terminate (pid ):
110
110
"""Terminates a process
111
111
112
- This function terminates a running process, sending a SIGKILL on
113
- Posix systems and using ctypes.windll on Windows.
112
+ This function terminates a running process using it's pid (process
113
+ ID), sending a SIGKILL on Posix systems and using ctypes.windll
114
+ on Windows.
115
+
116
+ Raises MySQLServerError on errors.
114
117
"""
115
118
if os .name == 'nt' :
116
119
winkernel = ctypes .windll .kernel32
117
- process = winkernel .OpenProcess (1 , 0 , pid )
118
- winkernel .TerminateProcess (process , - 1 )
119
- winkernel .WaitForSingleObject (process )
120
+ process = winkernel .OpenProcess (0x0001 , 0 , pid ) # PROCESS_TERMINATE
121
+ winkernel .TerminateProcess (process , 1 )
120
122
winkernel .CloseHandle (process )
121
123
else :
122
124
os .kill (pid , signal .SIGTERM )
You can’t perform that action at this time.
0 commit comments