Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Execution count after SyntaxError #1070

Closed
wants to merge 1 commit into from

3 participants

@takluyver
Owner

After a SyntaxError in code run by run_cell, only increment execution count where we would normally (i.e. if store_history is True).

Trivial change, but it's right in our core machinery, so I thought I'd let someone else have a quick look.

Closes gh-633

@fperez
Owner

Didn't last long without an open PR, heh? :) I'll have a look later today, thanks.

@takluyver takluyver closed this pull request from a commit
@takluyver takluyver After a SyntaxError in code run by run_cell, only increment execution…
… count where we would normally.

Closes gh-633
closes gh-1070
762b0ea
@takluyver takluyver closed this in 762b0ea
@minrk
Owner

Sensible, straightforward, merged.

@ellisonbg ellisonbg referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@mattvonrocketstein mattvonrocketstein referenced this pull request from a commit in mattvonrocketstein/ipython
@takluyver takluyver After a SyntaxError in code run by run_cell, only increment execution…
… count where we would normally.

Closes gh-633
closes gh-1070
26c83b0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 30, 2011
  1. @takluyver

    After a SyntaxError in code run by run_cell, only increment execution…

    takluyver authored
    … count where we would normally.
    
    Closes gh-633
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 2 deletions.
  1. +4 −2 IPython/core/interactiveshell.py
View
6 IPython/core/interactiveshell.py
@@ -2371,12 +2371,14 @@ def run_cell(self, raw_cell, store_history=False):
code_ast = self.compile.ast_parse(cell, filename=cell_name)
except IndentationError:
self.showindentationerror()
- self.execution_count += 1
+ if store_history:
+ self.execution_count += 1
return None
except (OverflowError, SyntaxError, ValueError, TypeError,
MemoryError):
self.showsyntaxerror()
- self.execution_count += 1
+ if store_history:
+ self.execution_count += 1
return None
self.run_ast_nodes(code_ast.body, cell_name,
Something went wrong with that request. Please try again.