From ca9875d651932ac93a768c1989ab03b2fd9e3ebb Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Mon, 15 Aug 2016 23:52:10 -0500 Subject: [PATCH] Py3 compatibility: don't import exceptions (Fix #136) --- pyopencl/cffi_cl.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pyopencl/cffi_cl.py b/pyopencl/cffi_cl.py index 2a2a120a..02d5b7da 100644 --- a/pyopencl/cffi_cl.py +++ b/pyopencl/cffi_cl.py @@ -584,6 +584,9 @@ class LogicError(Error): pass +_py_RuntimeError = RuntimeError + + class RuntimeError(Error): pass @@ -593,8 +596,7 @@ def _handle_error(error): return if error.other == 1: # non-pyopencl exceptions are handled here - import exceptions - e = exceptions.RuntimeError(_ffi_pystr(error.msg)) + e = _py_RuntimeError(_ffi_pystr(error.msg)) _lib.free_pointer(error.msg) _lib.free_pointer(error) raise e -- GitLab