py3: use b"%d" instead of str() to convert int to bytes
authorPulkit Goyal <7895pulkit@gmail.com>
Sat, 14 Apr 2018 02:04:19 +0530
changeset 45659 701c261fba838b3ddbebce8fe7b54fea4807bd42
parent 45658 46e705b793235edb234ab1a1e616b45762be8ecd
child 45660 2a42ca2679e211b9cca714a4f45320725aa9149e
push id787
push usergszorc@mozilla.com
push dateSat, 14 Apr 2018 19:23:41 +0000
py3: use b"%d" instead of str() to convert int to bytes While I was here, I added 'and None' to suppress return values of .write() calls. Differential Revision: https://phab.mercurial-scm.org/D3328
tests/test-clone-uncompressed.t
--- a/tests/test-clone-uncompressed.t
+++ b/tests/test-clone-uncompressed.t
@@ -13,17 +13,17 @@ Initialize repository
 the status call is to check for issue5130
 
   $ hg init server
   $ cd server
   $ touch foo
   $ hg -q commit -A -m initial
   >>> for i in range(1024):
   ...     with open(str(i), 'wb') as fh:
-  ...         fh.write(str(i))
+  ...         fh.write(b"%d" % i) and None
   $ hg -q commit -A -m 'add a lot of files'
   $ hg st
   $ hg --config server.uncompressed=false serve -p $HGPORT -d --pid-file=hg.pid
   $ cat hg.pid > $DAEMON_PIDS
   $ cd ..
 
 Cannot stream clone when server.uncompressed is set