Skip to content

Commit 1b56083

Browse files
author
Geert Vanderkelen
committed
Merge branch 'BUG18814880' into develop
2 parents 67883f8 + 59fe76a commit 1b56083

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tests/mysqld.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,16 @@ def process_running(pid):
109109
def process_terminate(pid):
110110
"""Terminates a process
111111
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.
114117
"""
115118
if os.name == 'nt':
116119
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)
120122
winkernel.CloseHandle(process)
121123
else:
122124
os.kill(pid, signal.SIGTERM)

0 commit comments

Comments
 (0)