# HG changeset patch # User Marcin Kuzminski # Date 1318384781 18000 # Node ID d6cb805c92fd1656455179bc3dd32eae172b6313 # Parent cba42a9e9164cae0addfe30f4ff403d0db5e1839 moved kill function to compat diff -r cba42a9e9164 -r d6cb805c92fd rhodecode/lib/compat.py --- a/rhodecode/lib/compat.py Wed Oct 12 00:29:13 2011 +0200 +++ b/rhodecode/lib/compat.py Tue Oct 11 20:59:41 2011 -0500 @@ -24,6 +24,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +import os +from rhodecode import __platform__, PLATFORM_WIN + #============================================================================== # json #============================================================================== @@ -358,3 +361,19 @@ # OrderedSet #============================================================================== from sqlalchemy.util import OrderedSet + + +#============================================================================== +# kill FUNCTIONS +#============================================================================== +if __platform__ in PLATFORM_WIN: + import ctypes + + def kill(pid, sig): + """kill function for Win32""" + kernel32 = ctypes.windll.kernel32 + handle = kernel32.OpenProcess(1, 0, pid) + return (0 != kernel32.TerminateProcess(handle, 0)) + +else: + kill = os.kill diff -r cba42a9e9164 -r d6cb805c92fd rhodecode/lib/pidlock.py --- a/rhodecode/lib/pidlock.py Wed Oct 12 00:29:13 2011 +0200 +++ b/rhodecode/lib/pidlock.py Tue Oct 11 20:59:41 2011 -0500 @@ -6,20 +6,7 @@ from warnings import warn from multiprocessing.util import Finalize -from rhodecode import __platform__, PLATFORM_WIN - -if __platform__ in PLATFORM_WIN: - import ctypes - - def kill(pid, sig): - """kill function for Win32""" - kernel32 = ctypes.windll.kernel32 - handle = kernel32.OpenProcess(1, 0, pid) - return (0 != kernel32.TerminateProcess(handle, 0)) - -else: - kill = os.kill - +from rhodecode.lib.compat import kill class LockHeld(Exception): pass