Permalink
Browse files

Don't call ast.fix_missing_locations unless the AST could have been m…

…odified.

Should close gh-2879
  • Loading branch information...
takluyver committed Feb 5, 2013
1 parent 6300dac commit 84cfd30c2c9b4fdaedbc9b2ea7280ee5b400cdd8
Showing with 3 additions and 1 deletion.
  1. +3 −1 IPython/core/interactiveshell.py
@@ -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',

0 comments on commit 84cfd30

Please sign in to comment.