changeset 35115:1ac4c0887de4

run-test: drop 'execfile' usage for 'common-pattern.py' file This is required for Python 3.
author Boris Feld <boris.feld@octobus.net>
date Sun, 19 Nov 2017 04:11:21 +0100
parents 6a8e85702121
children bd2743936b56
files tests/run-tests.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Sun Nov 19 04:10:55 2017 +0100
+++ b/tests/run-tests.py	Sun Nov 19 04:11:21 2017 +0100
@@ -973,8 +973,11 @@
 
         if os.path.exists(replacementfile):
             data = {}
-            execfile(replacementfile, data)
-            r.extend(data.get('substitutions', ()))
+            with open(replacementfile, mode='rb') as source:
+                # the intermediate 'compile' step help with debugging
+                code = compile(source.read(), replacementfile, 'exec')
+                exec(code, data)
+                r.extend(data.get('substitutions', ()))
         return r
 
     def _escapepath(self, p):