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

Conversation

@felixzhuologist
Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor Author

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?

@Carreau

This comment has been minimized.

Copy link
Member

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 :-)

@Carreau Carreau added this to the 7.1 milestone Oct 9, 2018

@felixzhuologist

This comment has been minimized.

Copy link
Contributor Author

commented Oct 9, 2018

Awesome, that works. Thanks!

@minrk minrk merged commit 940dd60 into ipython:master Oct 10, 2018

4 checks passed

codecov/patch 86.66% of diff hit (target 0%)
Details
codecov/project 68.22% (+<.01%) compared to 65d5900
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@minrk

This comment has been minimized.

Copy link
Member

commented Oct 10, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.