Преглед на файлове

Use exec() rather than execfile()

execfile() is not in Python 3.

Change-Id: I5af222340f13c1e8edaa820e7675d3e4d62a1689
Anthony King преди 11 години
родител
ревизия
70f6890352
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      project.py

+ 2 - 1
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))