Commits

mattip  committed 0c1854a

fix translation

  • Participants
  • Parent commits 9f1534f
  • Branches win32-kill

Comments (0)

Files changed (2)

File pypy/module/posix/interp_posix.py

     """Abort the interpreter immediately.  This 'dumps core' or otherwise fails
 in the hardest way possible on the hosting operating system."""
     import signal
-    os.kill(os.getpid(), signal.SIGABRT)
+    rwin32.os_kill(os.getpid(), signal.SIGABRT)
 
 @unwrap_spec(src='str0', dst='str0')
 def link(space, src, dst):

File pypy/rlib/rwin32.py

         return rffi.cast(lltype.Signed, _GetCurrentProcessId())
     def os_kill(pid, sig):
         if sig == CTRL_C_EVENT or sig == CTRL_BREAK_EVENT:
-            if 0 == GenerateConsoleCtrlEvent(sig, pid):
+            if GenerateConsoleCtrlEvent(sig, pid) == 0:
                 raise lastWindowsError('os_kill failed generating event')
-            return 0
         handle = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
         if handle == NULL_HANDLE:
             raise lastWindowsError('os_kill failed opening process')
             err = lastWindowsError('os_kill failed to terminate process')
             CloseHandle(handle)
             raise err
-        c = CloseHandle(handle)
-        if 0 == int(c):
+        t = CloseHandle(handle)
+        if t == 0:
             raise lastWindowsError('os_kill after terminating process,'
                      ' while closing handle') 
 else: