mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
[lit] Use py2&3 compatible exec() syntax.
llvm-svn: 187862
This commit is contained in:
parent
e3dc2d9d07
commit
5a2d7118d8
@ -1,6 +1,8 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
PY2 = sys.version_info[0] < 3
|
||||||
|
|
||||||
class TestingConfig:
|
class TestingConfig:
|
||||||
""""
|
""""
|
||||||
TestingConfig - Information on the tests inside a suite.
|
TestingConfig - Information on the tests inside a suite.
|
||||||
@ -59,7 +61,11 @@ class TestingConfig:
|
|||||||
cfg_globals['lit'] = litConfig
|
cfg_globals['lit'] = litConfig
|
||||||
cfg_globals['__file__'] = path
|
cfg_globals['__file__'] = path
|
||||||
try:
|
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:
|
if litConfig.debug:
|
||||||
litConfig.note('... loaded config %r' % path)
|
litConfig.note('... loaded config %r' % path)
|
||||||
except SystemExit:
|
except SystemExit:
|
||||||
|
Loading…
Reference in New Issue
Block a user