Skip to content

Commit 7cac76c

Browse files
cclaussMylesBorins
cclauss
authored andcommitted
tools: prepare tools/specialize_node_d.py for Python 3
PR-URL: #24797 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 526ff1d commit 7cac76c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tools/specialize_node_d.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@
1212

1313
if len(sys.argv) != 5:
1414
print("usage: specialize_node_d.py outfile src/node.d flavor arch")
15-
sys.exit(2);
15+
sys.exit(2)
1616

17-
outfile = file(sys.argv[1], 'w');
18-
infile = file(sys.argv[2], 'r');
19-
flavor = sys.argv[3];
20-
arch = sys.argv[4];
17+
outfile = open(sys.argv[1], 'w')
18+
infile = open(sys.argv[2], 'r')
19+
flavor = sys.argv[3]
20+
arch = sys.argv[4]
2121

2222
model = r'curpsinfo->pr_dmodel == PR_MODEL_ILP32'
2323

2424
for line in infile:
2525
if flavor == 'freebsd':
26-
line = re.sub('procfs.d', 'psinfo.d', line);
26+
line = re.sub('procfs.d', 'psinfo.d', line)
2727
if arch == 'x64':
28-
line = re.sub(model, '0', line);
28+
line = re.sub(model, '0', line)
2929
else:
30-
line = re.sub(model, '1', line);
31-
outfile.write(line);
30+
line = re.sub(model, '1', line)
31+
outfile.write(line)

0 commit comments

Comments
 (0)