From 77ba04466cd77c789016b1ce83e31bbccafb6f2f Mon Sep 17 00:00:00 2001
From: cgohlke <cgohlke@uci.edu>
Date: Thu, 29 May 2014 14:49:49 -0700
Subject: [PATCH] Fix AttributeError: 'Win32Platform' object has no attribute
 'GLX'

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

diff --git a/pyopencl/tools.py b/pyopencl/tools.py
index ea0d66db..ceaa2350 100644
--- a/pyopencl/tools.py
+++ b/pyopencl/tools.py
@@ -419,18 +419,20 @@ def get_arg_offset_adjuster_code(arg_types):
 def get_gl_sharing_context_properties():
     ctx_props = cl.context_properties
 
-    from OpenGL import platform as gl_platform, GLX, WGL
+    from OpenGL import platform as gl_platform
 
     props = []
 
     import sys
     if sys.platform in ["linux", "linux2"]:
+        from OpenGL import GLX
         props.append(
             (ctx_props.GL_CONTEXT_KHR, gl_platform.GetCurrentContext()))
         props.append(
                 (ctx_props.GLX_DISPLAY_KHR,
                     GLX.glXGetCurrentDisplay()))
     elif sys.platform == "win32":
+        from OpenGL import WGL
         props.append(
             (ctx_props.GL_CONTEXT_KHR, gl_platform.GetCurrentContext()))
         props.append(
-- 
GitLab