3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-04-23 13:25:31 +00:00

minor fixes after testing

This commit is contained in:
Ed Bordin 2020-08-08 15:35:51 +10:00
parent 20ec63899a
commit daa8329baa

View file

@ -61,7 +61,7 @@ def _create_process_lookup():
pe = pointer(PROCESSENTRY32())
pe.contents.dwSize = sizeof(PROCESSENTRY32)
pid_lookup = {}
if windll.kernel32. (handle, pe) != 0:
if windll.kernel32.Process32First(handle, pe) != 0:
_update_lookup(pid_lookup, pe)
while windll.kernel32.Process32Next(handle, pe) != 0:
_update_lookup(pid_lookup, pe)
@ -83,6 +83,6 @@ def win_killpg(pid):
try:
# "Any other value for sig will cause the process to be
# unconditionally killed by the TerminateProcess API"
os.kill(p, sig=-1)
except PermissionError as pe:
print("WARNING: error while killing pid {}: {}".format(p, pe))
os.kill(p, -1)
except (PermissionError, OSError) as e:
print("WARNING: error while killing pid {}: {}".format(p, e))