diff --git a/aksetup_helper.py b/aksetup_helper.py
index a168adf7a381ca8c33d005493030bdf7fab9addf..91e9ac0c56e48f33f14b8d60586b2dcb14e95862 100644
--- a/aksetup_helper.py
+++ b/aksetup_helper.py
@@ -716,7 +716,9 @@ def substitute(substitutions, fname):
     string_var_re = re.compile(r"\$str\{([A-Za-z_0-9]+)\}")
 
     fname_in = fname+".in"
-    lines = open(fname_in, "r").readlines()
+    with open(fname_in, "r") as inf:
+        lines = inf.readlines()
+
     new_lines = []
     for line in lines:
         made_change = True
@@ -746,7 +748,8 @@ def substitute(substitutions, fname):
     new_lines.insert(1, "# DO NOT EDIT THIS FILE -- "
             "it was generated by configure.py\n")
     new_lines.insert(2, "# %s\n" % (" ".join(sys.argv)))
-    open(fname, "w").write("".join(new_lines))
+    with open(fname, "w") as outf:
+        outf.write("".join(new_lines))
 
     from os import stat, chmod
     infile_stat_res = stat(fname_in)
diff --git a/configure.py b/configure.py
index 63edd4b997e7a83f6d182359cbafe5078b126a60..85c9841d9f995805d8b64bb8aae976b6ecc43ba3 100755
--- a/configure.py
+++ b/configure.py
@@ -1,6 +1,4 @@
-#! /usr/bin/env python
-
-from __future__ import absolute_import
+#! /usr/bin/env python3
 
 from aksetup_helper import configure_frontend
 configure_frontend()
diff --git a/pyopencl/compyte b/pyopencl/compyte
index 3367a19729cfe42d51133453b7bdfa1756a853d9..d1f993daecc03947d9e6e3e60d2a5145ecbf3786 160000
--- a/pyopencl/compyte
+++ b/pyopencl/compyte
@@ -1 +1 @@
-Subproject commit 3367a19729cfe42d51133453b7bdfa1756a853d9
+Subproject commit d1f993daecc03947d9e6e3e60d2a5145ecbf3786