diff --git a/pyopencl/__init__.py b/pyopencl/__init__.py index bf09cf55c28a2ce4cd470380fea767ec82deac1e..0a965564c4f95d52714eb1b6e8279d7d2dfe69c8 100644 --- a/pyopencl/__init__.py +++ b/pyopencl/__init__.py @@ -408,14 +408,6 @@ class Program: self._prg = _cl._create_program_with_il(context, source) return - import sys - if isinstance(source, str) and sys.version_info < (3,): - from warnings import warn - warn("Received OpenCL source code in Unicode, " - "should be ASCII string. Attempting conversion.", - stacklevel=2) - source = source.encode() - self._context = context self._source = source self._prg = None diff --git a/pyopencl/ipython_ext.py b/pyopencl/ipython_ext.py index 619ac5908b2bc1925ad302146b6b116e638b532e..c0b80fa56c2fba6aaa76145413b1f53b64bea642 100644 --- a/pyopencl/ipython_ext.py +++ b/pyopencl/ipython_ext.py @@ -1,22 +1,11 @@ from IPython.core.magic import (magics_class, Magics, cell_magic, line_magic) import pyopencl as cl -import sys - - -def _try_to_utf8(text): - if isinstance(text, str): - return text.encode("utf8") - return text @magics_class class PyOpenCLMagics(Magics): def _run_kernel(self, kernel, options): - if sys.version_info < (3,): - kernel = _try_to_utf8(kernel) - options = _try_to_utf8(options).strip() - try: ctx = self.shell.user_ns["cl_ctx"] except KeyError: