Skip to content

Commit a82f259

Browse files
committed
Update aksetup
1 parent 0919bc3 commit a82f259

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

aksetup_helper.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,9 @@ def substitute(substitutions, fname):
716716
string_var_re = re.compile(r"\$str\{([A-Za-z_0-9]+)\}")
717717

718718
fname_in = fname+".in"
719-
lines = open(fname_in, "r").readlines()
719+
with open(fname_in, "r") as inf:
720+
lines = inf.readlines()
721+
720722
new_lines = []
721723
for line in lines:
722724
made_change = True
@@ -746,7 +748,8 @@ def substitute(substitutions, fname):
746748
new_lines.insert(1, "# DO NOT EDIT THIS FILE -- "
747749
"it was generated by configure.py\n")
748750
new_lines.insert(2, "# %s\n" % (" ".join(sys.argv)))
749-
open(fname, "w").write("".join(new_lines))
751+
with open(fname, "w") as outf:
752+
outf.write("".join(new_lines))
750753

751754
from os import stat, chmod
752755
infile_stat_res = stat(fname_in)

configure.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#! /usr/bin/env python
2-
3-
from __future__ import absolute_import
1+
#! /usr/bin/env python3
42

53
from aksetup_helper import configure_frontend
64
configure_frontend()

0 commit comments

Comments
 (0)