diff options
| author | Sarah Owens <sarato@inkylabs.com> | 2012-11-01 22:59:27 -0700 |
|---|---|---|
| committer | Sarah Owens <sarato@inkylabs.com> | 2012-11-13 17:33:56 -0800 |
| commit | cecd1d864fc3cf02cf50d367111e0d0e173c5dc6 (patch) | |
| tree | b4f660400560dce21cd7a00ffe5a5d74b54bcb81 /project.py | |
| parent | fc241240d828d7e8302dc0876608a9d27ae1cbc7 (diff) | |
| download | git-repo-cecd1d864fc3cf02cf50d367111e0d0e173c5dc6.tar.gz | |
Change print statements to work in python3
This is part of a series of changes to introduce Python3 support.
Change-Id: I373be5de7141aa127d7debdbce1df39148dbec32
Diffstat (limited to 'project.py')
| -rw-r--r-- | project.py | 14 |
1 files changed, 8 insertions, 6 deletions
| @@ -12,6 +12,7 @@ | |||
| 12 | # See the License for the specific language governing permissions and | 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. | 13 | # limitations under the License. |
| 14 | 14 | ||
| 15 | from __future__ import print_function | ||
| 15 | import traceback | 16 | import traceback |
| 16 | import errno | 17 | import errno |
| 17 | import filecmp | 18 | import filecmp |
| @@ -50,7 +51,7 @@ def _lwrite(path, content): | |||
| 50 | 51 | ||
| 51 | def _error(fmt, *args): | 52 | def _error(fmt, *args): |
| 52 | msg = fmt % args | 53 | msg = fmt % args |
| 53 | print >>sys.stderr, 'error: %s' % msg | 54 | print('error: %s' % msg, file=sys.stderr) |
| 54 | 55 | ||
| 55 | def not_rev(r): | 56 | def not_rev(r): |
| 56 | return '^' + r | 57 | return '^' + r |
| @@ -683,9 +684,9 @@ class Project(object): | |||
| 683 | if not os.path.isdir(self.worktree): | 684 | if not os.path.isdir(self.worktree): |
| 684 | if output_redir == None: | 685 | if output_redir == None: |
| 685 | output_redir = sys.stdout | 686 | output_redir = sys.stdout |
| 686 | print >>output_redir, '' | 687 | print(file=output_redir) |
| 687 | print >>output_redir, 'project %s/' % self.relpath | 688 | print('project %s/' % self.relpath, file=output_redir) |
| 688 | print >>output_redir, ' missing (run "repo sync")' | 689 | print(' missing (run "repo sync")', file=output_redir) |
| 689 | return | 690 | return |
| 690 | 691 | ||
| 691 | self.work_git.update_index('-q', | 692 | self.work_git.update_index('-q', |
| @@ -785,7 +786,7 @@ class Project(object): | |||
| 785 | out.project('project %s/' % self.relpath) | 786 | out.project('project %s/' % self.relpath) |
| 786 | out.nl() | 787 | out.nl() |
| 787 | has_diff = True | 788 | has_diff = True |
| 788 | print line[:-1] | 789 | print(line[:-1]) |
| 789 | p.Wait() | 790 | p.Wait() |
| 790 | 791 | ||
| 791 | 792 | ||
| @@ -1586,7 +1587,8 @@ class Project(object): | |||
| 1586 | # returned another error with the HTTP error code being 400 or above. | 1587 | # returned another error with the HTTP error code being 400 or above. |
| 1587 | # This return code only appears if -f, --fail is used. | 1588 | # This return code only appears if -f, --fail is used. |
| 1588 | if not quiet: | 1589 | if not quiet: |
| 1589 | print >> sys.stderr, "Server does not provide clone.bundle; ignoring." | 1590 | print("Server does not provide clone.bundle; ignoring.", |
| 1591 | file=sys.stderr) | ||
| 1590 | return False | 1592 | return False |
| 1591 | 1593 | ||
| 1592 | if os.path.exists(tmpPath): | 1594 | if os.path.exists(tmpPath): |
