Skip to content

Commit

Permalink
Py3 compatibility: don't import exceptions (Fix #136)
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Aug 16, 2016
1 parent 8738638 commit ca9875d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pyopencl/cffi_cl.py
Expand Up @@ -584,6 +584,9 @@ class LogicError(Error):
pass


_py_RuntimeError = RuntimeError


class RuntimeError(Error):
pass

Expand All @@ -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
Expand Down

0 comments on commit ca9875d

Please sign in to comment.