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

Remove now redundant re.UNICODE and (?u) #2058

Merged
merged 1 commit into from
Jan 31, 2022
Merged

Conversation

jeanas
Copy link
Contributor

@jeanas jeanas commented Jan 31, 2022

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.

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.
@birkenfeld
Copy link
Member

LGTM, thanks!

@birkenfeld birkenfeld merged commit c81e97c into pygments:master Jan 31, 2022
@Anteru Anteru added the changelog-update Items which need to get mentioned in the changelog label Jan 31, 2022
@Anteru Anteru self-assigned this Jan 31, 2022
@Anteru Anteru added this to the 2.12.0 milestone Jan 31, 2022
@jeanas
Copy link
Contributor Author

jeanas commented Feb 1, 2022

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?

@birkenfeld
Copy link
Member

Probably due to #2053 - don't worry about it.

@jeanas
Copy link
Contributor Author

jeanas commented Feb 1, 2022

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
@Anteru Anteru removed the changelog-update Items which need to get mentioned in the changelog label Feb 20, 2022
@jeanas jeanas deleted the unicode branch September 1, 2023 16:51
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

Successfully merging this pull request may close these issues.

3 participants