Commits

Marcin Kuzminski  committed d6cb805

moved kill function to compat

  • Participants
  • Parent commits cba42a9

Comments (0)

Files changed (2)

File rhodecode/lib/compat.py

 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+import os
+from rhodecode import __platform__, PLATFORM_WIN
+
 #==============================================================================
 # json
 #==============================================================================
 # 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

File rhodecode/lib/pidlock.py

 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