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

nonlocal with no existing variable produces too many errors #2651

Closed
lebigot opened this issue Dec 5, 2012 · 1 comment
Closed

nonlocal with no existing variable produces too many errors #2651

lebigot opened this issue Dec 5, 2012 · 1 comment
Milestone

Comments

@lebigot
Copy link
Contributor

lebigot commented Dec 5, 2012

The following code

def f():
    nonlocal x
    x = 123

shows additional, IPython errors after the normal SyntaxError:

During handling of the above exception, another exception occurred:
(…)
TypeError: %d format: a number is required, not NoneType

During handling of the above exception, another exception occurred:
(…)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/IPython/core/ultratb.py", line 573, in _format_exception_only
  Colors.linenoEm, value.lineno, Colors.Normal  ))

TypeError: %d format: a number is required, not NoneType

It seems to me that the latter errors should not be printed.

@takluyver
Copy link
Member

Thanks, this has already been fixed in master - see pull request #2503.

@minrk minrk modified the milestones: no action, 1.0 Mar 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants