From 90da562baf505858dd45416bbfb6d138a35ae031 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Sat, 17 Mar 2012 21:25:28 -0400
Subject: [PATCH] =?UTF-8?q?Fix=20missing=20import=20when=20cache=5Fdir=20s?=
 =?UTF-8?q?pecified.=20(report=20by=20Guilherme=20Gon=C3=A7alves=20Ferrari?=
 =?UTF-8?q?)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 pyopencl/cache.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pyopencl/cache.py b/pyopencl/cache.py
index c194f623..bf368d4a 100644
--- a/pyopencl/cache.py
+++ b/pyopencl/cache.py
@@ -302,6 +302,8 @@ class _SourceInfo(Record):
     pass
 
 def _create_built_program_from_source_cached(ctx, src, options, devices, cache_dir):
+    from os.path import join # required in multiple places below
+
     include_path = ["."]
 
     option_idx = 0
@@ -319,7 +321,6 @@ def _create_built_program_from_source_cached(ctx, src, options, devices, cache_d
             option_idx += 1
 
     if cache_dir is None:
-        from os.path import join
         from tempfile import gettempdir
         import getpass
         cache_dir = join(gettempdir(),
-- 
GitLab