Skip to content

Commit

Permalink
Don't call ast.fix_missing_locations unless the AST could have been m…
Browse files Browse the repository at this point in the history
…odified.

Should close ipythongh-2879
  • Loading branch information
takluyver committed Feb 5, 2013
1 parent 6300dac commit 84cfd30
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion IPython/core/interactiveshell.py
Expand Up @@ -2695,7 +2695,9 @@ def transform_ast(self, node):
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',
Expand Down

0 comments on commit 84cfd30

Please sign in to comment.