mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-23 07:16:21 +00:00
Merge "Use exec() rather than execfile()"
This commit is contained in:
commit
5196805fa2
@ -438,7 +438,8 @@ class RepoHook(object):
|
|||||||
# and convert to a HookError w/ just the failing traceback.
|
# and convert to a HookError w/ just the failing traceback.
|
||||||
context = {}
|
context = {}
|
||||||
try:
|
try:
|
||||||
execfile(self._script_fullpath, context)
|
exec(compile(open(self._script_fullpath).read(),
|
||||||
|
self._script_fullpath, 'exec'), context)
|
||||||
except Exception:
|
except Exception:
|
||||||
raise HookError('%s\nFailed to import %s hook; see traceback above.' % (
|
raise HookError('%s\nFailed to import %s hook; see traceback above.' % (
|
||||||
traceback.format_exc(), self._hook_type))
|
traceback.format_exc(), self._hook_type))
|
||||||
|
Loading…
Reference in New Issue
Block a user