# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1511061081 -3600
#      Sun Nov 19 04:11:21 2017 +0100
# Node ID 1ac4c0887de41b1fbbd048cc6cad799677eee99f
# Parent  6a8e857021219404e9f7316fe7253e6a3799f8f6
run-test: drop 'execfile' usage for 'common-pattern.py' file

This is required for Python 3.

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -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):