aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts/fix_msvc_output.py
diff options
context:
space:
mode:
authorNikita Slyusarev <nslus@yandex-team.com>2022-02-10 16:46:52 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:52 +0300
commitcd77cecfc03a3eaf87816af28a33067c4f0cdb59 (patch)
tree1308e0bae862d52e0020d881fe758080437fe389 /build/scripts/fix_msvc_output.py
parentcdae02d225fb5b3afbb28990e79a7ac6c9125327 (diff)
downloadydb-cd77cecfc03a3eaf87816af28a33067c4f0cdb59.tar.gz
Restoring authorship annotation for Nikita Slyusarev <nslus@yandex-team.com>. Commit 1 of 2.
Diffstat (limited to 'build/scripts/fix_msvc_output.py')
-rw-r--r--build/scripts/fix_msvc_output.py58
1 files changed, 29 insertions, 29 deletions
diff --git a/build/scripts/fix_msvc_output.py b/build/scripts/fix_msvc_output.py
index b2e7d38307..4fda5b6321 100644
--- a/build/scripts/fix_msvc_output.py
+++ b/build/scripts/fix_msvc_output.py
@@ -1,13 +1,13 @@
-import subprocess
-import sys
-
+import subprocess
+import sys
+
import process_command_files as pcf
import process_whole_archive_option as pwa
-
-def out2err(cmd):
- return subprocess.Popen(cmd, stdout=sys.stderr).wait()
-
-
+
+def out2err(cmd):
+ return subprocess.Popen(cmd, stdout=sys.stderr).wait()
+
+
def decoding_needed(strval):
if sys.version_info >= (3, 0, 0):
return isinstance(strval, bytes)
@@ -15,28 +15,28 @@ def decoding_needed(strval):
return False
-def out2err_cut_first_line(cmd):
- p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
- first_line = True
- while True:
- line = p.stdout.readline()
+def out2err_cut_first_line(cmd):
+ p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
+ first_line = True
+ while True:
+ line = p.stdout.readline()
line = line.decode('utf-8') if decoding_needed(line) else line
- if not line:
- break
- if first_line:
- sys.stdout.write(line)
- first_line = False
- else:
- sys.stderr.write(line)
- return p.wait()
-
-
-if __name__ == '__main__':
+ if not line:
+ break
+ if first_line:
+ sys.stdout.write(line)
+ first_line = False
+ else:
+ sys.stderr.write(line)
+ return p.wait()
+
+
+if __name__ == '__main__':
mode = sys.argv[1]
args, wa_peers, wa_libs = pwa.get_whole_archive_peers_and_libs(pcf.skip_markers(sys.argv[2:]))
cmd = pwa.ProcessWholeArchiveOption('WINDOWS', wa_peers, wa_libs).construct_cmd(args)
- run = out2err
- if mode in ('cl', 'ml'):
- # First line of cl.exe and ml64.exe stdout is useless: it prints input file
- run = out2err_cut_first_line
- sys.exit(run(cmd))
+ run = out2err
+ if mode in ('cl', 'ml'):
+ # First line of cl.exe and ml64.exe stdout is useless: it prints input file
+ run = out2err_cut_first_line
+ sys.exit(run(cmd))