summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorConley Owens <cco3@android.com>2014-05-07 18:18:55 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-05-07 18:18:56 +0000
commit5196805fa28aa8873f76b2baa7b0fd52ec52d915 (patch)
tree5f53332a6bc401cd372bc852fdec9a5eea366acb /project.py
parent85b24acd6a11af3d84cc71fc35ebdb6d3c78065f (diff)
parent70f6890352ef8f12cdc859b5a4eb0c4e8e37152c (diff)
downloadgit-repo-5196805fa28aa8873f76b2baa7b0fd52ec52d915.tar.gz
Merge "Use exec() rather than execfile()"
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 897f4c90..55c188db 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))