From 84cfd30c2c9b4fdaedbc9b2ea7280ee5b400cdd8 2013-02-05 15:24:56 From: Thomas Kluyver Date: 2013-02-05 15:24:56 Subject: [PATCH] Don't call ast.fix_missing_locations unless the AST could have been modified. Should close gh-2879 --- diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index 554bcde..661a6b5 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -2695,7 +2695,9 @@ class InteractiveShell(SingletonConfigurable): warn("AST transformer %r threw an error. It will be unregistered." % transformer) self.ast_transformers.remove(transformer) - return ast.fix_missing_locations(node) + if self.ast_transformers: + ast.fix_missing_locations(node) + return node def run_ast_nodes(self, nodelist, cell_name, interactivity='last_expr',