diff -Nru ipython-2.3.0/debian/changelog ipython-2.3.0/debian/changelog --- ipython-2.3.0/debian/changelog 2014-10-02 19:16:57.000000000 +0000 +++ ipython-2.3.0/debian/changelog 2014-11-09 22:44:25.000000000 +0000 @@ -1,3 +1,11 @@ +ipython (2.3.0-2) unstable; urgency=medium + + * Team upload. + * Add pygments2.0_compatibility.patch (taken from Carlos Cordoba's pull + request. Closes: #768705) + + -- Piotr Ożarowski Sun, 09 Nov 2014 23:33:24 +0100 + ipython (2.3.0-1) unstable; urgency=medium * New upstream bugfix release diff -Nru ipython-2.3.0/debian/patches/pygments2.0_compatibility.patch ipython-2.3.0/debian/patches/pygments2.0_compatibility.patch --- ipython-2.3.0/debian/patches/pygments2.0_compatibility.patch 1970-01-01 00:00:00.000000000 +0000 +++ ipython-2.3.0/debian/patches/pygments2.0_compatibility.patch 2014-11-09 22:43:35.000000000 +0000 @@ -0,0 +1,40 @@ +From: Carlos Cordoba +Subject: Update pygments monkeypatch for compatibility with Pygments 2.0 + +Origin: upstream, https://github.com/ipython/ipython/pull/6878 +Bug: https://github.com/ipython/ipython/issues/6877 +Bug-Debian: http://bugs.debian.org/768705 +Index: ipython-2.3.0/IPython/qt/console/pygments_highlighter.py +=================================================================== +--- ipython-2.3.0.orig/IPython/qt/console/pygments_highlighter.py ++++ ipython-2.3.0/IPython/qt/console/pygments_highlighter.py +@@ -12,6 +12,11 @@ def get_tokens_unprocessed(self, text, s + """ Split ``text`` into (tokentype, text) pairs. + + Monkeypatched to store the final stack on the object itself. ++ ++ The `text` parameter this gets passed is only the current line, so to ++ highlight things like multiline strings correctly, we need to retrieve ++ the state from the previous line (this is done in PygmentsHighlighter, ++ below), and use it to continue processing the current line. + """ + pos = 0 + tokendefs = self._tokens +@@ -24,11 +29,12 @@ def get_tokens_unprocessed(self, text, s + for rexmatch, action, new_state in statetokens: + m = rexmatch(text, pos) + if m: +- if type(action) is _TokenType: +- yield pos, action, m.group() +- else: +- for item in action(self, m): +- yield item ++ if action is not None: ++ if type(action) is _TokenType: ++ yield pos, action, m.group() ++ else: ++ for item in action(self, m): ++ yield item + pos = m.end() + if new_state is not None: + # state transition diff -Nru ipython-2.3.0/debian/patches/series ipython-2.3.0/debian/patches/series --- ipython-2.3.0/debian/patches/series 2014-10-02 19:16:57.000000000 +0000 +++ ipython-2.3.0/debian/patches/series 2014-11-09 22:28:26.000000000 +0000 @@ -5,3 +5,4 @@ no-submodule-check.patch packaged-js.patch split-pkg.patch +pygments2.0_compatibility.patch