diff options
author | Anthony King <anthonydking@slimroms.net> | 2014-05-05 21:15:34 +0100 |
---|---|---|
committer | Anthony King <anthonydking@slimroms.net> | 2014-05-05 23:41:07 +0100 |
commit | 70f6890352ef8f12cdc859b5a4eb0c4e8e37152c (patch) | |
tree | be462ac3016d1e455928d9a64287bb85ddf3821f /project.py | |
parent | 666d534636d262cbfd971509dd0f0be0cddb2e11 (diff) | |
download | git-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.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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)) |