Remove now redundant re.UNICODE and (?u)#2058
Merged
birkenfeld merged 1 commit intopygments:masterfrom Jan 31, 2022
Merged
Conversation
In Python 3, re.UNICODE, corresponding to the (?u) modifier, is always used by default. This removes its now unnecessary explicit usage. In lexers that had "flags = re.MULTILINE | re.UNICODE", this line is just removed since (without lexer inheritance) re.MULTILINE is the default. Elsewhere, re.UNICODE is removed from the list of flags. In the CoqLexer, there was just re.UNICODE; it can be removed altogether (bringing in re.MULTILINE) because the lexer doesn't use ^ and $ anyway.
Member
|
LGTM, thanks! |
Contributor
Author
|
Ouch, GitHub tells me that this has caused a CI failure: https://github.com/Jean-Abou-Samra/pygments/actions/runs/1774370914. What I don't understand is why it has not been shown here -- everything was green. How comes that it failed later? (Sorry if this is a dumb question, I'm more used to GitLab and somewhat lost in GitHub's CI interface.) It seems to have failed with Python 3.9.10 on an infinite loop, but I cannot reproduce this locally -- the complete test suite passes for me with Python 3.9.7. Any clue? |
Member
|
Probably due to #2053 - don't worry about it. |
Contributor
Author
|
Alright, I see now the test with random input. Thank you for reassuring me; must have been unrelated indeed. |
This was referenced Feb 3, 2022
Merged
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.
In Python 3, re.UNICODE, corresponding to the (?u) modifier,
is always used by default. This removes its now unnecessary
explicit usage. In lexers that had "flags = re.MULTILINE | re.UNICODE",
this line is just removed since (without lexer inheritance) re.MULTILINE
is the default. Elsewhere, re.UNICODE is removed from the list
of flags. In the CoqLexer, there was just re.UNICODE; it can be
removed altogether (bringing in re.MULTILINE) because the lexer
doesn't use ^ and $ anyway.