[2.7] bpo-31285: fix an assertion failure and a SystemError in warnings.warn_explicit (GH-3219)#3823
Merged
serhiy-storchaka merged 1 commit intopython:2.7from Sep 30, 2017
Merged
Conversation
serhiy-storchaka
approved these changes
Sep 29, 2017
Member
serhiy-storchaka
left a comment
There was a problem hiding this comment.
LGTM. Could you please squash the commits and write correct commit message?
c7f1726 to
2169500
Compare
Contributor
Author
|
I tried to follow the guidelines in https://devguide.python.org/gitbootcamp/#accepting-and-merging-a-pull-request. |
Member
|
This is no assertion in 2.7, isn't? |
Contributor
Author
|
No assertion in 2.7, but i thought that it is required that the title is the same as the one we backport from. I would fix that. |
…) in case __loader__.get_source() has a bad splitlines() method. (pythonGH-3219)
2169500 to
c15236b
Compare
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 removed (from the original PR) the test that verifies that the assertion failure is no more, because in 2.7, the code assumes that the value returned by splitlines() is a string, and uses it without asserting it is a string, in such a way that causing some error (for testing purposes) is not simple (at least i didn't find a simple way).
ISTM that the first test is good enough to verify that the splitlines() attribute is ignored, and PyUnicode_Splitlines() is used directly.
https://bugs.python.org/issue31285