mercurial/utils/procutil.py
changeset 45042 c88577199023
parent 45041 1053f878dd46
child 45043 be58fb1eaa73
equal deleted inserted replaced
45041:1053f878dd46 45042:c88577199023
    34 
    34 
    35 # Import like this to keep import-checker happy
    35 # Import like this to keep import-checker happy
    36 from ..utils import resourceutil
    36 from ..utils import resourceutil
    37 
    37 
    38 osutil = policy.importmod('osutil')
    38 osutil = policy.importmod('osutil')
       
    39 
       
    40 if pycompat.iswindows:
       
    41     from .. import windows as platform
       
    42 else:
       
    43     from .. import posix as platform
    39 
    44 
    40 
    45 
    41 def isatty(fp):
    46 def isatty(fp):
    42     try:
    47     try:
    43         return fp.isatty()
    48         return fp.isatty()
    92         stdout = make_line_buffered(stdout)
    97         stdout = make_line_buffered(stdout)
    93     else:
    98     else:
    94         stdout = os.fdopen(stdout.fileno(), 'wb', 1)
    99         stdout = os.fdopen(stdout.fileno(), 'wb', 1)
    95 
   100 
    96 if pycompat.iswindows:
   101 if pycompat.iswindows:
    97     from .. import windows as platform
       
    98 
       
    99     stdout = platform.winstdout(stdout)
   102     stdout = platform.winstdout(stdout)
   100 else:
   103 
   101     from .. import posix as platform
       
   102 
   104 
   103 findexe = platform.findexe
   105 findexe = platform.findexe
   104 _gethgcmd = platform.gethgcmd
   106 _gethgcmd = platform.gethgcmd
   105 getuser = platform.getuser
   107 getuser = platform.getuser
   106 getpid = os.getpid
   108 getpid = os.getpid