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

Fix misplaced regexp flags arguments #2730

Merged
merged 2 commits into from Apr 20, 2017
Merged

Fix misplaced regexp flags arguments #2730

merged 2 commits into from Apr 20, 2017

Conversation

@jwilk
Copy link
Contributor

@jwilk jwilk commented Apr 19, 2017

Pull Request Checklist

  • I’ve read the guidelines for contributing.
  • I updated AUTHORS.txt and CHANGES.txt (if the change is non-trivial) and documentation (if applicable).
  • I tested my changes.

(I don't plan to complete this checklist myself. Sorry!)

Description

This fixes multiple invalid uses of flags in re.sub() and re.compile(...).sub() calls.
Some of these problems were found using pydiatra.

jwilk added 2 commits Apr 19, 2017
The 4th argument of re.sub() is maximum number of substitutions,
not flags.
Regular expression flags cannot be passed in the sub() method.
They have to bet set at compile time.
Copy link
Contributor

@felixfontein felixfontein left a comment

LGTM

@felixfontein felixfontein requested a review from Kwpolska Apr 20, 2017
Copy link
Member

@Kwpolska Kwpolska left a comment

LGTM

@Kwpolska Kwpolska merged commit b37e435 into getnikola:master Apr 20, 2017
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
codacy/pr Good work! A positive pull request.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@felixfontein
Copy link
Contributor

@felixfontein felixfontein commented Apr 20, 2017

Thanks a lot for noticing and fixing this, @jwilk!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants