gclient_utils: Stop using execfile()

execfile() does not exist in Python 3; replace it with open(), read()
and exec().

Bug: 984182
Change-Id: I2266ff2bd63bffc458bd04500c8c0d6c360f1b4a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1844831
Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
changes/31/1844831/2
Raphael Kubo da Costa 6 years ago committed by Commit Bot
parent 4102985e14
commit 107c97c837

@ -704,7 +704,8 @@ def GetGClientRootAndEntries(path=None):
return None
config_path = os.path.join(root, config_file)
env = {}
execfile(config_path, env)
with open(config_path) as config:
exec(config.read(), env)
config_dir = os.path.dirname(config_path)
return config_dir, env['entries']

Loading…
Cancel
Save