aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts/f2c.py
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /build/scripts/f2c.py
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
downloadydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'build/scripts/f2c.py')
-rw-r--r--build/scripts/f2c.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/build/scripts/f2c.py b/build/scripts/f2c.py
index 7021e1391f..243d3965a4 100644
--- a/build/scripts/f2c.py
+++ b/build/scripts/f2c.py
@@ -1,8 +1,8 @@
-import sys
-import subprocess
-import argparse
-import os
-
+import sys
+import subprocess
+import argparse
+import os
+
header = '''\
#ifdef __GNUC__
@@ -30,11 +30,11 @@ def mkdir_p(directory):
if __name__ == '__main__':
parser = argparse.ArgumentParser()
-
+
parser.add_argument('-t', '--tool')
parser.add_argument('-c', '--input')
parser.add_argument('-o', '--output')
-
+
args = parser.parse_args()
tmpdir = args.output + '.f2c'
mkdir_p(tmpdir)
@@ -44,14 +44,14 @@ if __name__ == '__main__':
stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
stdout, stderr = p.communicate(input=open(args.input).read())
ret = p.wait()
-
+
if ret:
print >>sys.stderr, 'f2c failed: %s, %s' % (stderr, ret)
sys.exit(ret)
-
+
if 'Error' in stderr:
print >>sys.stderr, stderr
-
+
with open(args.output, 'w') as f:
f.write(header)
f.write(stdout)