diff options
author | Daniel Dunbar <daniel@zuster.org> | 2013-08-07 03:25:28 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2013-08-07 03:25:28 +0000 |
commit | 9286ee62920806fc695fc3be23b51b73cb707cb5 (patch) | |
tree | 0fb8944812a2ed70c26238d21c474b9c3e2c23f9 | |
parent | 09a28f6973599b3c2e12f19e1d3f91e12de77ff7 (diff) | |
download | external_llvm-9286ee62920806fc695fc3be23b51b73cb707cb5.zip external_llvm-9286ee62920806fc695fc3be23b51b73cb707cb5.tar.gz external_llvm-9286ee62920806fc695fc3be23b51b73cb707cb5.tar.bz2 |
[lit] Use py2&3 compatible exec() syntax.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187862 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | utils/lit/lit/TestingConfig.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/utils/lit/lit/TestingConfig.py b/utils/lit/lit/TestingConfig.py index 25168d7..f4ff89f 100644 --- a/utils/lit/lit/TestingConfig.py +++ b/utils/lit/lit/TestingConfig.py @@ -1,6 +1,8 @@ import os import sys +PY2 = sys.version_info[0] < 3 + class TestingConfig: """" TestingConfig - Information on the tests inside a suite. @@ -59,7 +61,11 @@ class TestingConfig: cfg_globals['lit'] = litConfig cfg_globals['__file__'] = path try: - exec f in cfg_globals + data = f.read() + if PY2: + exec("exec data in cfg_globals") + else: + exec(data, cfg_globals) if litConfig.debug: litConfig.note('... loaded config %r' % path) except SystemExit: |