mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-19 02:25:01 +00:00
[lit] Use py2&3 compatible exec() syntax.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187862 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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:
|
||||||
|
Reference in New Issue
Block a user