mirror of
https://git.codelinaro.org/clo/tools/repo.git
synced 2025-06-17 08:33:40 +08:00
Change print statements to work in python3
This is part of a series of changes to introduce Python3 support. Change-Id: I373be5de7141aa127d7debdbce1df39148dbec32
This commit is contained in:
14
project.py
14
project.py
@ -12,6 +12,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from __future__ import print_function
|
||||
import traceback
|
||||
import errno
|
||||
import filecmp
|
||||
@ -50,7 +51,7 @@ def _lwrite(path, content):
|
||||
|
||||
def _error(fmt, *args):
|
||||
msg = fmt % args
|
||||
print >>sys.stderr, 'error: %s' % msg
|
||||
print('error: %s' % msg, file=sys.stderr)
|
||||
|
||||
def not_rev(r):
|
||||
return '^' + r
|
||||
@ -683,9 +684,9 @@ class Project(object):
|
||||
if not os.path.isdir(self.worktree):
|
||||
if output_redir == None:
|
||||
output_redir = sys.stdout
|
||||
print >>output_redir, ''
|
||||
print >>output_redir, 'project %s/' % self.relpath
|
||||
print >>output_redir, ' missing (run "repo sync")'
|
||||
print(file=output_redir)
|
||||
print('project %s/' % self.relpath, file=output_redir)
|
||||
print(' missing (run "repo sync")', file=output_redir)
|
||||
return
|
||||
|
||||
self.work_git.update_index('-q',
|
||||
@ -785,7 +786,7 @@ class Project(object):
|
||||
out.project('project %s/' % self.relpath)
|
||||
out.nl()
|
||||
has_diff = True
|
||||
print line[:-1]
|
||||
print(line[:-1])
|
||||
p.Wait()
|
||||
|
||||
|
||||
@ -1586,7 +1587,8 @@ class Project(object):
|
||||
# returned another error with the HTTP error code being 400 or above.
|
||||
# This return code only appears if -f, --fail is used.
|
||||
if not quiet:
|
||||
print >> sys.stderr, "Server does not provide clone.bundle; ignoring."
|
||||
print("Server does not provide clone.bundle; ignoring.",
|
||||
file=sys.stderr)
|
||||
return False
|
||||
|
||||
if os.path.exists(tmpPath):
|
||||
|
Reference in New Issue
Block a user