diff --git a/pyopencl/__init__.py b/pyopencl/__init__.py index 7576680e0b596c42605f4532a02687ae6f539486..9f9b6c92c4771cb1af2e7d610985f17df48050ec 100644 --- a/pyopencl/__init__.py +++ b/pyopencl/__init__.py @@ -379,7 +379,13 @@ class Program(object): # use single quotes, and put single quotes into double quotes # the string $'b is then quoted as '$'"'"'b' - return b"'" + s.replace(b"'", b"'\"'\"'") + b"'" + import sys + if sys.platform.startswith("win"): + # not sure how to escape that + assert '"' not in s + return b'"' + s + b'"' + else: + return b"'" + s.replace(b"'", b"'\"'\"'") + b"'" @classmethod def _process_build_options(cls, context, options):