# HG changeset patch # User Manuel Jacob # Date 1593854504 -7200 # Node ID c8857719902381f516c176f8ddf3d8263bd34463 # Parent 1053f878dd46885aa92aff2e161038c8c5221d6d procutil: split import and reassignment Besides making the code clearer, it will reduce the diff in the next patch. diff -r 1053f878dd46 -r c88577199023 mercurial/utils/procutil.py --- a/mercurial/utils/procutil.py Sat Jul 04 11:15:58 2020 +0200 +++ b/mercurial/utils/procutil.py Sat Jul 04 11:21:44 2020 +0200 @@ -37,6 +37,11 @@ osutil = policy.importmod('osutil') +if pycompat.iswindows: + from .. import windows as platform +else: + from .. import posix as platform + def isatty(fp): try: @@ -94,11 +99,8 @@ stdout = os.fdopen(stdout.fileno(), 'wb', 1) if pycompat.iswindows: - from .. import windows as platform + stdout = platform.winstdout(stdout) - stdout = platform.winstdout(stdout) -else: - from .. import posix as platform findexe = platform.findexe _gethgcmd = platform.gethgcmd