From c85ada52d3970acd6fc4ac8bbcd41a5c6fc8187b Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Fri, 1 Apr 2016 00:49:13 -0500 Subject: [PATCH] Attempt to fix Windows escaping --- pyopencl/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pyopencl/__init__.py b/pyopencl/__init__.py index 7576680e..9f9b6c92 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): -- GitLab