Skip to content

Commit

Permalink
[lit] Remove Python 2.6 and below exec workaround
Browse files Browse the repository at this point in the history
Summary:
The minimum version of Python required to run LLVM's test suite is 2.7.
Remove a workaround for older Python versions.

Reviewers: echristo, delcypher, beanz, ddunbar

Subscribers: llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D25400

llvm-svn: 283705
  • Loading branch information
modocache committed Oct 10, 2016
1 parent 64378f4 commit ea76cdb
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions llvm/utils/lit/lit/TestingConfig.py
@@ -1,7 +1,6 @@
import os
import sys

OldPy = sys.version_info[0] == 2 and sys.version_info[1] < 7

class TestingConfig:
""""
Expand Down Expand Up @@ -73,24 +72,20 @@ def load_from_path(self, path, litConfig):

# Load the config script data.
data = None
if not OldPy:
f = open(path)
try:
data = f.read()
except:
litConfig.fatal('unable to load config file: %r' % (path,))
f.close()
f = open(path)
try:
data = f.read()
except:
litConfig.fatal('unable to load config file: %r' % (path,))
f.close()

# Execute the config script to initialize the object.
cfg_globals = dict(globals())
cfg_globals['config'] = self
cfg_globals['lit_config'] = litConfig
cfg_globals['__file__'] = path
try:
if OldPy:
execfile(path, cfg_globals)
else:
exec(compile(data, path, 'exec'), cfg_globals, None)
exec(compile(data, path, 'exec'), cfg_globals, None)
if litConfig.debug:
litConfig.note('... loaded config %r' % path)
except SystemExit:
Expand Down

0 comments on commit ea76cdb

Please sign in to comment.