From 70f6890352ef8f12cdc859b5a4eb0c4e8e37152c Mon Sep 17 00:00:00 2001 From: Anthony King Date: Mon, 5 May 2014 21:15:34 +0100 Subject: [PATCH] Use exec() rather than execfile() execfile() is not in Python 3. Change-Id: I5af222340f13c1e8edaa820e7675d3e4d62a1689 --- project.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/project.py b/project.py index 127176e5..771071c8 100644 --- a/project.py +++ b/project.py @@ -438,7 +438,8 @@ class RepoHook(object): # and convert to a HookError w/ just the failing traceback. context = {} try: - execfile(self._script_fullpath, context) + exec(compile(open(self._script_fullpath).read(), + self._script_fullpath, 'exec'), context) except Exception: raise HookError('%s\nFailed to import %s hook; see traceback above.' % ( traceback.format_exc(), self._hook_type))