[llvm] r187862 - [lit] Use py2&3 compatible exec() syntax.
Daniel Dunbar
daniel at zuster.org
Tue Aug 6 20:25:28 PDT 2013
Author: ddunbar
Date: Tue Aug 6 22:25:28 2013
New Revision: 187862
URL: http://llvm.org/viewvc/llvm-project?rev=187862&view=rev
Log:
[lit] Use py2&3 compatible exec() syntax.
Modified:
llvm/trunk/utils/lit/lit/TestingConfig.py
Modified: llvm/trunk/utils/lit/lit/TestingConfig.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/TestingConfig.py?rev=187862&r1=187861&r2=187862&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/TestingConfig.py (original)
+++ llvm/trunk/utils/lit/lit/TestingConfig.py Tue Aug 6 22:25:28 2013
@@ -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:
More information about the llvm-commits
mailing list