Commit 0c3906f4 authored by Milad Farazmand's avatar Milad Farazmand Committed by Commit Bot

Fix an error caused by a bug in Python < 2.7.9

There seems to be a bug in Python versions prior
to 2.7.9 where running exec could produce the following error:

SyntaxError: unqualified exec is not allowed in function
'_ParsePythonTestTemplates' it contains a nested function
with free variables (testcfg.py, line 71)

https://bugs.python.org/issue21591

It's causing an issue on all Ubuntu 14 and RHEL 7 machines.

The proposed change is an equivalent syntax which doesn't
produce an error:
https://docs.python.org/2/reference/simple_stmts.html#the-exec-statement


Change-Id: I159cc1be58ff375f313ae5c4fb814763704b880e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1893647Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#64736}
parent 18a5750b
......@@ -68,7 +68,7 @@ class TestSuite(testsuite.TestSuite):
return MkTest
with open(pathname) as f:
text = f.read()
exec(text, {"Test": Test, "Template": Template})
exec text in {"Test": Test, "Template": Template}
def ListTests(self):
result = []
......
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