Open
Conversation
`index` was counting lines, not just of the traceback but of leading outputs as well (which are collected in `all_else`). Wether a line contained the location data or the corresponding source code was determined by checking if `index` was odd or even. This worked if there was an odd number of lines before the stacktrace but if there was no output before the stacktrace it skipped the first line of location info, interpreted the corresponding source code line as location info and the location info of the next entry as it's source code. Depending on the number of commas in the corresponding source code line this problem was more or less obvious. I have solved this by toggling a boolean variable called `location_info` instead of using `index`. The last entry of the stack trace is skipped because the 2nd for loop in _extract_traceback iterates over `entries[:-2]` where `entries[-1]` is the error message and `entries[-2]` is the last entry of the stack trace.
This comment seems wrong to me. This block is executed if capture is False. capture is set to True when starting to parse the stack trace and never reset to False. Therefore it is executed for each line *before* the stack trace. Also, there should be nothing after the stack trace.
strip() removes all white space, including linebreaks.
Therefore there was nothing left to do for the strip('\n').
https://docs.python.org/3/library/stdtypes.html#str.strip
AssertionErrors don't need to have an error message.
Author
|
Travis failed for Python 3.4 with the message
I'm afraid there is not much I can do about that. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I think this resolves #16.
Please see the commit messages for 3c86dd6 and 7e58cff.