Skip to content

Commit f797ba7

Browse files
authored
Merge pull request #147 from carandraug/py2-to-py3-replace-execfile
Replace use of execfile removed in Python 3
2 parents 5a7aba6 + 641e341 commit f797ba7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/mod_python.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ def cmd_genconfig():
6464
if len(args) != 1:
6565
parser.error("Must specify <src>")
6666

67-
execfile(args[0])
67+
src = args[0]
68+
with open(src, "rb") as fh:
69+
exec(compile(fh.read(), src, "exec"))
6870

6971
def cmd_create():
7072

0 commit comments

Comments
 (0)