Merge branch 'PY-10179' of https://github.com/Amarchuk/intellij-community into Amarch...
authorDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Wed, 26 Feb 2014 13:00:33 +0000 (14:00 +0100)
committerDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Wed, 26 Feb 2014 13:00:33 +0000 (14:00 +0100)
python/src/com/jetbrains/python/console/PydevConsoleExecuteActionHandler.java
python/src/com/jetbrains/python/console/RunPythonConsoleAction.java

index b4d83600b7b96ed2d0f204aab32bf0555ec66218..9a835315486f8e4fc14cb8f3993fa9d3895cbc4b 100644 (file)
@@ -137,13 +137,12 @@ public class PydevConsoleExecuteActionHandler extends ProcessBackedConsoleExecut
 
     // multiline strings handling
     if (myInMultilineStringState != null) {
-      if (PyConsoleUtil.isDoubleQuoteMultilineStarts(line)) {
+      if (PyConsoleUtil.isDoubleQuoteMultilineStarts(line) || PyConsoleUtil.isSingleQuoteMultilineStarts(line)) {
         myInMultilineStringState = null;
         // restore language
         console.setLanguage(PythonLanguage.getInstance());
         console.setPrompt(PyConsoleUtil.ORDINARY_PROMPT);
-      }
-      else {
+      } else {
         return;
       }
     }
index 9c610e768b28204f274d81bbe51f6cd70440b547..728056cca3012818ec31cbe1d44528b9eefe25b3 100644 (file)
@@ -221,7 +221,7 @@ public class RunPythonConsoleAction extends AnAction implements DumbAware {
     final String path = Joiner.on(", ").join(Collections2.transform(pythonPath, new Function<String, String>() {
       @Override
       public String apply(String input) {
-        return "'" + input.replace("\\", "\\\\") + "'";
+        return "'" + input.replace("\\", "\\\\").replace("'", "\\'") + "'";
       }
     }));