1
0
mirror of https://github.com/golang/go synced 2024-11-12 00:20:22 -07:00

lib/codereview/codereview.py: fix crash when hg gofmt has no files

The gofmt function was returning a string, which isn't the right type.
Three cheers for dynamic typing.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7917044
This commit is contained in:
Rob Pike 2013-03-26 17:32:22 -07:00
parent 5f9a9433ea
commit 50231fa19f

View File

@ -1762,7 +1762,8 @@ def gofmt(ui, repo, *pats, **opts):
files = ChangedExistingFiles(ui, repo, pats, opts)
files = gofmt_required(files)
if not files:
return "no modified go files"
ui.status("no modified go files\n")
return
cwd = os.getcwd()
files = [RelativePath(repo.root + '/' + f, cwd) for f in files]
try: