[commit: ghc] master: testlib: Make TyCon normalization Python 2.6-compatible (a1e01b6)

git at git.haskell.org git at git.haskell.org
Tue Dec 29 17:43:04 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/a1e01b61d4e083ac4ed59c593c89970143986f1a/ghc

>---------------------------------------------------------------

commit a1e01b61d4e083ac4ed59c593c89970143986f1a
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Tue Dec 29 18:16:59 2015 +0100

    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


>---------------------------------------------------------------

a1e01b61d4e083ac4ed59c593c89970143986f1a
 testsuite/driver/testlib.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index cf5a226..6b2220f 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -1697,12 +1697,11 @@ def normalise_callstacks(str):
     # Ignore line number differences in call stacks (#10834).
     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):
     """ Normalise out fingerprints from Typeable TyCon representations """
-    return re.sub(r'TyCon\s*\d+L?\#\#\s*\d+L?\#\#\s*',
-                  'TyCon FINGERPRINT FINGERPRINT ',
-                  str,
-                  flags=re.MULTILINE)
+    return re.sub(tyCon_re, 'TyCon FINGERPRINT FINGERPRINT ', str)
 
 def normalise_errmsg( str ):
     # remove " error:" and lower-case " Warning:" to make patch for



More information about the ghc-commits mailing list