From 466fb95e5a84f949280048b93cf67bc6a7ce5db8 2017-01-13 20:44:43 From: Thomas Kluyver Date: 2017-01-13 20:44:43 Subject: [PATCH] Well, since you ask me for Python 2.7 support... --- diff --git a/IPython/core/inputtransformer.py b/IPython/core/inputtransformer.py index fe43396..ab7c499 100644 --- a/IPython/core/inputtransformer.py +++ b/IPython/core/inputtransformer.py @@ -131,7 +131,8 @@ class TokenInputTransformer(InputTransformer): def reset_tokenizer(self): it = iter(self.buf) - self.tokenizer = generate_tokens(it.__next__) + nxt = it.__next__ if PY3 else it.next + self.tokenizer = generate_tokens(nxt) def push(self, line): self.buf.append(line + '\n')