summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorAnthony King <anthonydking@slimroms.net>2014-05-05 21:15:34 +0100
committerAnthony King <anthonydking@slimroms.net>2014-05-05 23:41:07 +0100
commit70f6890352ef8f12cdc859b5a4eb0c4e8e37152c (patch)
treebe462ac3016d1e455928d9a64287bb85ddf3821f /project.py
parent666d534636d262cbfd971509dd0f0be0cddb2e11 (diff)
downloadgit-repo-70f6890352ef8f12cdc859b5a4eb0c4e8e37152c.tar.gz
Use exec() rather than execfile()
execfile() is not in Python 3. Change-Id: I5af222340f13c1e8edaa820e7675d3e4d62a1689
Diffstat (limited to 'project.py')
-rw-r--r--project.py3
1 files changed, 2 insertions, 1 deletions
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):
438 # and convert to a HookError w/ just the failing traceback. 438 # and convert to a HookError w/ just the failing traceback.
439 context = {} 439 context = {}
440 try: 440 try:
441 execfile(self._script_fullpath, context) 441 exec(compile(open(self._script_fullpath).read(),
442 self._script_fullpath, 'exec'), context)
442 except Exception: 443 except Exception:
443 raise HookError('%s\nFailed to import %s hook; see traceback above.' % ( 444 raise HookError('%s\nFailed to import %s hook; see traceback above.' % (
444 traceback.format_exc(), self._hook_type)) 445 traceback.format_exc(), self._hook_type))