##// END OF EJS Templates
Backport PR #2773: Fixed minor typo causing AttributeError to be thrown....
Backport PR #2773: Fixed minor typo causing AttributeError to be thrown. I'm not sure how I caused the error to be thrown and couldn't reproduce it with the same call again, nevertheless I think the fix is correct. ```python In [21]: rc.shutdown(hub=True) Traceback (most recent call last): File "<ipython-input-21-977a05a15f31>", line 1, in <module> rc.shutdown(hub=True) File "<string>", line 2, in shutdown File "c:\dev\code\ipython\IPython\parallel\client\client.py", line 69, in spin_first self.spin() File "c:\dev\code\ipython\IPython\parallel\client\client.py", line 1005, in spin self._flush_notifications() File "c:\dev\code\ipython\IPython\parallel\client\client.py", line 800, in _flush_notifications raise Exception("Unhandled message type: %s"%msg.msg_type) AttributeError: 'dict' object has no attribute 'msg_type' ```

File last commit:

r6058:ecc950ec
r9855:7ad908bf
Show More
README-IPython.rst
33 lines | 1.6 KiB | text/x-rst | RstLexer

CodeMirror in IPython

We carry a mostly unmodified copy of CodeMirror. The current version we use is (please update this information when updating versions):

CodeMirror c813c94

The only changes we've applied so far are these:

diff --git a/IPython/frontend/html/notebook/static/codemirror/mode/python/python.js b/IPython/frontend/html/notebook/static/codemirror/mode/python/python.js
index ca94e7a..fc9a503 100644
--- a/IPython/frontend/html/notebook/static/codemirror/mode/python/python.js
+++ b/IPython/frontend/html/notebook/static/codemirror/mode/python/python.js
@@ -5,7 +5,11 @@ CodeMirror.defineMode("python", function(conf, parserConf) {
         return new RegExp("^((" + words.join(")|(") + "))\\b");
     }

-    var singleOperators = new RegExp("^[\\+\\-\\*/%&|\\^~<>!]");
+    // IPython-specific changes: add '?' as recognized character.
+    //var singleOperators = new RegExp("^[\\+\\-\\*/%&|\\^~<>!]");
+    var singleOperators = new RegExp("^[\\+\\-\\*/%&|\\^~<>!\\?]");
+    // End IPython changes.
+
     var singleDelimiters = new RegExp('^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]');
     var doubleOperators = new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))");
     var doubleDelimiters = new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))");

In practice it's just a one-line change, adding \? to singleOperators, surrounded by a comment. We'll turn this into a proper patchset if it ever gets more complicated than this, but for now this note should be enough.