[PATCH 1 of 2] run-tests: avoid printing extra newlines from install log

Gregory Szorc gregory.szorc at gmail.com
Sat Feb 7 00:33:15 UTC 2015


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1423268102 28800
#      Fri Feb 06 16:15:02 2015 -0800
# Node ID a758be135cf4455492970d4e8c0bc29b60562e41
# Parent  975f6586908de6526bf5165d09f8622437a682e5
run-tests: avoid printing extra newlines from install log

If an installation error occurs, we print the install log. Before,
output had extra newlines because we were using "print" on data that was
already newline terminated.

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1869,9 +1869,9 @@ class TestRunner(object):
                 os.remove(installerrs)
         else:
             f = open(installerrs, 'rb')
             for line in f:
-                print line
+                sys.stdout.write(line)
             f.close()
             sys.exit(1)
         os.chdir(self._testdir)
 


More information about the Mercurial-devel mailing list