Commit a1e01b61 authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari
Browse files

testlib: Make TyCon normalization Python 2.6-compatible

D1629 introduced this normalization which was not Python 2.6 compatible
due to the use of the `flags` argument of `re.sub`. Fix this.

Test Plan: Validate

Reviewers: austin, thomie

Differential Revision: https://phabricator.haskell.org/D1718
parent fcc76493
...@@ -1697,12 +1697,11 @@ def normalise_callstacks(str): ...@@ -1697,12 +1697,11 @@ def normalise_callstacks(str):
# Ignore line number differences in call stacks (#10834). # Ignore line number differences in call stacks (#10834).
return re.sub(', called at (.+):[\\d]+:[\\d]+ in [\\w\-\.]+:', repl, str) return re.sub(', called at (.+):[\\d]+:[\\d]+ in [\\w\-\.]+:', repl, str)
tyCon_re = re.compile(r'TyCon\s*\d+L?\#\#\s*\d+L?\#\#\s*', flags=re.MULTILINE)
def normalise_type_reps(str): def normalise_type_reps(str):
""" Normalise out fingerprints from Typeable TyCon representations """ """ Normalise out fingerprints from Typeable TyCon representations """
return re.sub(r'TyCon\s*\d+L?\#\#\s*\d+L?\#\#\s*', return re.sub(tyCon_re, 'TyCon FINGERPRINT FINGERPRINT ', str)
'TyCon FINGERPRINT FINGERPRINT ',
str,
flags=re.MULTILINE)
def normalise_errmsg( str ): def normalise_errmsg( str ):
# remove " error:" and lower-case " Warning:" to make patch for # remove " error:" and lower-case " Warning:" to make patch for
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment