mercurial/utils/procutil.py
changeset 52361 07a5a249faf8
parent 51859 f4733654f144
child 52582 1b9b6b4aa929
equal deleted inserted replaced
52360:fca7d38e040b 52361:07a5a249faf8
    22 from typing import (
    22 from typing import (
    23     BinaryIO,
    23     BinaryIO,
    24 )
    24 )
    25 
    25 
    26 from ..i18n import _
    26 from ..i18n import _
    27 from ..pycompat import (
       
    28     open,
       
    29 )
       
    30 
    27 
    31 from .. import (
    28 from .. import (
    32     encoding,
    29     encoding,
    33     error,
    30     error,
    34     policy,
    31     policy,
   341         code = system(cmd)
   338         code = system(cmd)
   342         if code:
   339         if code:
   343             raise error.Abort(
   340             raise error.Abort(
   344                 _(b"command '%s' failed: %s") % (cmd, explainexit(code))
   341                 _(b"command '%s' failed: %s") % (cmd, explainexit(code))
   345             )
   342             )
   346         with open(outname, b'rb') as fp:
   343         with open(outname, 'rb') as fp:
   347             return fp.read()
   344             return fp.read()
   348     finally:
   345     finally:
   349         try:
   346         try:
   350             if inname:
   347             if inname:
   351                 os.unlink(inname)
   348                 os.unlink(inname)