Fix compatibility with Python < 2.7
Review Request #6207 — Created Aug. 7, 2014 and submitted
My change for handling alternate casing in svn:keywords only worked with Python
2.7 (prior versions don't have a `flags` argument to `re.sub()`).This change makes it so we compile the regex first using re.IGNORECASE, and
then call the substitution method on the regex object.Testing done: Ran tests under python 2.6
Ran tests under python 2.6
-
Tool: Pyflakes Processed Files: reviewboard/scmtools/tests.py reviewboard/scmtools/svn.py Tool: PEP8 Style Checker Processed Files: reviewboard/scmtools/tests.py reviewboard/scmtools/svn.py
-
Instead of all this, you can just put
(?i)
at the very beginning of the regex string, and it'll activate the right flag.
Description: |
|
||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Commit: |
|
||||||||||||||||||||||||||||||||||||
Diff: |
Revision 3 (+24 -2) |