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')