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 inline list comprehensions #34

Closed
gruns opened this issue Jul 23, 2019 · 2 comments
Closed

Fix inline list comprehensions #34

gruns opened this issue Jul 23, 2019 · 2 comments

Comments

@gruns
Copy link
Owner

gruns commented Jul 23, 2019

E.g.

ic([i for i in range(3)])

yields

...
  File "/usr/local/lib/python3.6/dist-packages/icecream/icecream.py", line 522, in __call__
    out = self._format(callFrame, *args)
  File "/usr/local/lib/python3.6/dist-packages/icecream/icecream.py", line 557, in _format
    callFrame, icNames, icMethod, prefix, context, args)
  File "/usr/local/lib/python3.6/dist-packages/icecream/icecream.py", line 578, in _formatArgs
    for arg in extractArgumentsFromCallStr(callStr)]
  File "/usr/local/lib/python3.6/dist-packages/icecream/icecream.py", line 578, in <listcomp>
    for arg in extractArgumentsFromCallStr(callStr)]
  File "/usr/local/lib/python3.6/dist-packages/icecream/icecream.py", line 132, in collapseWhitespaceBetweenTokens
    t for t in tokenize.generate_tokens(StringIO(s).readline)
  File "/usr/local/lib/python3.6/dist-packages/icecream/icecream.py", line 132, in <listcomp>
    t for t in tokenize.generate_tokens(StringIO(s).readline)
  File "/usr/lib/python3.6/tokenize.py", line 595, in _tokenize
    raise TokenError("EOF in multi-line statement", (lnum, 0))
tokenize.TokenError: ('EOF in multi-line statement', (2, 0))

TODO(grun): Test if this is fixed by Alex's executing in #33.

@alexmojaki
Copy link
Collaborator

This is fixed now. I've bumped to 2.0.0. Can you release to PyPI?

@gruns
Copy link
Owner Author

gruns commented Oct 25, 2019

Can you release to PyPI?

With an ear-to-ear smile on my face.

I'll whip up a quick entry in changelog.txt and push shortly.

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

2 participants