[PATCH 2 of 4 py3] tests: make test-manifest finish importing in Python 3

Augie Fackler raf at durin42.com
Sun May 28 21:43:03 EDT 2017


# HG changeset patch
# User Augie Fackler <raf at durin42.com>
# Date 1496009316 14400
#      Sun May 28 18:08:36 2017 -0400
# Node ID 221e447c9410325c4051e61e762e2afd871a9b0f
# Parent  a6e3817ee02bbcc2480a233ceb161586348b211a
tests: make test-manifest finish importing in Python 3

The test is still broken, but now it executes.

diff --git a/tests/test-manifest.py b/tests/test-manifest.py
--- a/tests/test-manifest.py
+++ b/tests/test-manifest.py
@@ -92,11 +92,15 @@ A_DEEPER_MANIFEST = (
 
 HUGE_MANIFEST_ENTRIES = 200001
 
+izip = getattr(itertools, 'izip', zip)
+if 'xrange' not in globals():
+    xrange = range
+
 A_HUGE_MANIFEST = ''.join(sorted(
     'file%d\0%s%s\n' % (i, h, f) for i, h, f in
-    itertools.izip(xrange(200001),
-                   itertools.cycle((HASH_1, HASH_2)),
-                   itertools.cycle(('', 'x', 'l')))))
+    izip(xrange(200001),
+         itertools.cycle((HASH_1, HASH_2)),
+         itertools.cycle(('', 'x', 'l')))))
 
 class basemanifesttests(object):
     def parsemanifest(self, text):


More information about the Mercurial-devel mailing list