##// END OF EJS Templates
clean up lee's windows testpid fix.
Vadim Gelfer -
r2025:581d9a8b default
parent child Browse files
Show More
@@ -536,7 +536,7 b" if os.name == 'nt':"
536 536 return pf
537 537
538 538 try: # Mark Hammond's win32all package allows better functionality on Windows
539 import win32api, win32con, win32file, pywintypes
539 import win32api, win32con, win32file, winerror, pywintypes
540 540
541 541 # create hard links using win32file module
542 542 def os_link(src, dst): # NB will only succeed on NTFS
@@ -555,18 +555,16 b" if os.name == 'nt':"
555 555 return os.stat(pathname).st_nlink
556 556
557 557 def testpid(pid):
558 '''return True if pid is still running or unable to determine, False otherwise'''
558 '''return True if pid is still running or unable to
559 determine, False otherwise'''
559 560 try:
560 handle = win32api.OpenProcess(win32con.PROCESS_QUERY_INFORMATION, False, pid)
561 handle = win32api.OpenProcess(
562 win32con.PROCESS_QUERY_INFORMATION, False, pid)
561 563 if handle:
562 564 status = win32process.GetExitCodeProcess(handle)
563 if status == win32con.STILL_ACTIVE:
564 return True
565 else:
566 return False
565 return status == win32con.STILL_ACTIVE
567 566 except pywintypes.error, details:
568 if details[0] == 87: # ERROR_INVALID_PARAMETER
569 return False
567 return details[0] != winerror.ERROR_INVALID_PARAMETER
570 568 return True
571 569
572 570 except ImportError:
General Comments 0
You need to be logged in to leave comments. Login now