Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #11312: nonlocal does not raise SyntaxError #11382

Merged
merged 3 commits into from Oct 10, 2018
Merged

Fix #11312: nonlocal does not raise SyntaxError #11382

merged 3 commits into from Oct 10, 2018

Conversation

@felixzhuologist
Copy link
Contributor

@felixzhuologist felixzhuologist commented Oct 9, 2018

As we traverse the AST, keep track of the depth in terms of the function call stack so that we can check for different invalid AstNodes at each depth and terminate early when possible. Fixes #11312

@felixzhuologist
Copy link
Contributor Author

@felixzhuologist felixzhuologist commented Oct 9, 2018

@Carreau I'd like to add a test for this but I couldn't figure out how to run tests - I tried various forms of python3 -m unittest core.tests.test_async_helpers but ended up getting import errors. Would you be able to point me to some info about running unittests?

Loading

@Carreau
Copy link
Member

@Carreau Carreau commented Oct 9, 2018

running test is a bit weird as we are a python shell.
You need to not be in IPython directory and run iptest

To run a single test I would for example run

$ cd ; iptest IPython.core.tests.test_inputtransformer2:test_check_complete; cd -

You can also just push on the branch and let Travis CI work for you :-)

Loading

@Carreau Carreau added this to the 7.1 milestone Oct 9, 2018
@felixzhuologist
Copy link
Contributor Author

@felixzhuologist felixzhuologist commented Oct 9, 2018

Awesome, that works. Thanks!

Loading

@minrk minrk merged commit 940dd60 into ipython:master Oct 10, 2018
4 checks passed
Loading
@minrk
Copy link
Member

@minrk minrk commented Oct 10, 2018

Thanks!

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants