mercurial/win32.py
changeset 30667 5861bdbeb9a3
parent 30637 344e68882cd3
child 32664 2d56e6d23be7
equal deleted inserted replaced
30666:6ada1658fc6b 30667:5861bdbeb9a3
    12 import msvcrt
    12 import msvcrt
    13 import os
    13 import os
    14 import random
    14 import random
    15 import subprocess
    15 import subprocess
    16 
    16 
    17 from . import encoding
    17 from . import (
       
    18     encoding,
       
    19     pycompat,
       
    20 )
    18 
    21 
    19 _kernel32 = ctypes.windll.kernel32
    22 _kernel32 = ctypes.windll.kernel32
    20 _advapi32 = ctypes.windll.advapi32
    23 _advapi32 = ctypes.windll.advapi32
    21 _user32 = ctypes.windll.user32
    24 _user32 = ctypes.windll.user32
    22 
    25 
   438     comspec = encoding.environ.get("COMSPEC", "cmd.exe")
   441     comspec = encoding.environ.get("COMSPEC", "cmd.exe")
   439     args = comspec + " /c " + args
   442     args = comspec + " /c " + args
   440 
   443 
   441     res = _kernel32.CreateProcessA(
   444     res = _kernel32.CreateProcessA(
   442         None, args, None, None, False, _CREATE_NO_WINDOW,
   445         None, args, None, None, False, _CREATE_NO_WINDOW,
   443         env, os.getcwd(), ctypes.byref(si), ctypes.byref(pi))
   446         env, pycompat.getcwd(), ctypes.byref(si), ctypes.byref(pi))
   444     if not res:
   447     if not res:
   445         raise ctypes.WinError()
   448         raise ctypes.WinError()
   446 
   449 
   447     # _tochildpid because the process is the child of COMSPEC
   450     # _tochildpid because the process is the child of COMSPEC
   448     return _tochildpid(pi.dwProcessId)
   451     return _tochildpid(pi.dwProcessId)