-
Couldn't load subscription status.
- Fork 73
Fix source string exec #95
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
Conversation
birdseye/utils.py
Outdated
| '\n' if i < 2 and cookie_re.match(line) | ||
| else line | ||
| for i, line in enumerate(f) | ||
| line for line in linecache.cache[filename][2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to use linecache.getlines (not direct access to the cache) and needs to use it instead of opening the file (linecache will open the file if needed) but still checking cookie_re.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I hadn't realized that there was a getlines method as it's missing from the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
birdseye/utils.py
Outdated
| return ''.join([ | ||
| '\n' if i < 2 and cookie_re.match(line) | ||
| else line | ||
| for line in linecache.getlines(filename) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you forgot enumerate
|
I see the test failure, this actually makes me realise I need to take a different path to resolve this. So you don't need to try and fix this, I'll take care of it. |
|
Ended up not going with my original plan, but hey, this works. Thanks for your help! |
|
Released in 0.9.2 |
No description provided.