Merge "Allow using repo with python3"
diff --git a/docs/manifest-format.txt b/docs/manifest-format.txt
index dcc90d0..f63c9d0 100644
--- a/docs/manifest-format.txt
+++ b/docs/manifest-format.txt
@@ -27,15 +27,15 @@
                         remove-project*,
                         project*,
                         repo-hooks?)>
-  
+
     <!ELEMENT notice (#PCDATA)>
-  
+
     <!ELEMENT remote (EMPTY)>
     <!ATTLIST remote name         ID    #REQUIRED>
     <!ATTLIST remote alias        CDATA #IMPLIED>
     <!ATTLIST remote fetch        CDATA #REQUIRED>
     <!ATTLIST remote review       CDATA #IMPLIED>
-  
+
     <!ELEMENT default (EMPTY)>
     <!ATTLIST default remote      IDREF #IMPLIED>
     <!ATTLIST default revision    CDATA #IMPLIED>
@@ -46,7 +46,7 @@
 
     <!ELEMENT manifest-server (EMPTY)>
     <!ATTLIST url              CDATA #REQUIRED>
-  
+
     <!ELEMENT project (annotation?,
                        project*)>
     <!ATTLIST project name        CDATA #REQUIRED>
@@ -65,7 +65,7 @@
     <!ATTLIST annotation name  CDATA #REQUIRED>
     <!ATTLIST annotation value CDATA #REQUIRED>
     <!ATTLIST annotation keep  CDATA "true">
-  
+
     <!ELEMENT remove-project (EMPTY)>
     <!ATTLIST remove-project name  CDATA #REQUIRED>
 
diff --git a/project.py b/project.py
index 6631641..b01a52b 100644
--- a/project.py
+++ b/project.py
@@ -1840,11 +1840,11 @@
             cookiefile = line[len(prefix):]
             break
         if p.wait():
-          line = iter(p.stderr).next()
-          if ' -print_config' in line:
+          err_msg = p.stderr.read()
+          if ' -print_config' in err_msg:
             pass  # Persistent proxy doesn't support -print_config.
           else:
-            print(line + p.stderr.read(), file=sys.stderr)
+            print(err_msg, file=sys.stderr)
         if cookiefile:
           return cookiefile
       except OSError as e:
diff --git a/subcmds/branches.py b/subcmds/branches.py
index c2e7c4b..f714c1e 100644
--- a/subcmds/branches.py
+++ b/subcmds/branches.py
@@ -139,7 +139,7 @@
       if in_cnt < project_cnt:
         fmt = out.write
         paths = []
-        if in_cnt < project_cnt - in_cnt: 
+        if in_cnt < project_cnt - in_cnt:
           in_type = 'in'
           for b in i.projects:
             paths.append(b.project.relpath)