diff options
Diffstat (limited to 'project.py')
| -rw-r--r-- | project.py | 9 |
1 files changed, 5 insertions, 4 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)) |
| @@ -2321,8 +2322,8 @@ class Project(object): | |||
| 2321 | out = iter(out[:-1].split('\0')) # pylint: disable=W1401 | 2322 | out = iter(out[:-1].split('\0')) # pylint: disable=W1401 |
| 2322 | while out: | 2323 | while out: |
| 2323 | try: | 2324 | try: |
| 2324 | info = out.next() | 2325 | info = next(out) |
| 2325 | path = out.next() | 2326 | path = next(out) |
| 2326 | except StopIteration: | 2327 | except StopIteration: |
| 2327 | break | 2328 | break |
| 2328 | 2329 | ||
| @@ -2348,7 +2349,7 @@ class Project(object): | |||
| 2348 | info = _Info(path, *info) | 2349 | info = _Info(path, *info) |
| 2349 | if info.status in ('R', 'C'): | 2350 | if info.status in ('R', 'C'): |
| 2350 | info.src_path = info.path | 2351 | info.src_path = info.path |
| 2351 | info.path = out.next() | 2352 | info.path = next(out) |
| 2352 | r[info.path] = info | 2353 | r[info.path] = info |
| 2353 | return r | 2354 | return r |
| 2354 | finally: | 2355 | finally: |
