From 107c97c8377dce5576583bd4d8c5b26010737797 Mon Sep 17 00:00:00 2001 From: Raphael Kubo da Costa Date: Mon, 7 Oct 2019 18:04:26 +0000 Subject: [PATCH] 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 Commit-Queue: Edward Lesmes Reviewed-by: Edward Lesmes --- gclient_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gclient_utils.py b/gclient_utils.py index bec9e8d0c0..3a6bc1fa84 100644 --- a/gclient_utils.py +++ b/gclient_utils.py @@ -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']