From f42291ea64f5870e213f670ed3e5a94b64946444 Mon Sep 17 00:00:00 2001 From: Andrew n marshall Date: Fri, 20 Jul 2018 15:54:11 -0700 Subject: [PATCH] Do not escape % in python strings. (#1982) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rebase of PR-1890, commit 793055… from Ellipsis753:patch-1 --- generators/python.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/generators/python.js b/generators/python.js index 347a41c2f..1c25f7ba7 100644 --- a/generators/python.js +++ b/generators/python.js @@ -224,8 +224,7 @@ Blockly.Python.scrubNakedValue = function(line) { Blockly.Python.quote_ = function(string) { // Can't use goog.string.quote since % must also be escaped. string = string.replace(/\\/g, '\\\\') - .replace(/\n/g, '\\\n') - .replace(/\%/g, '\\%'); + .replace(/\n/g, '\\\n'); // Follow the CPython behaviour of repr() for a non-byte string. var quote = '\'';