revlog: adjust doctest examples to be portable to Python 3
authorAugie Fackler <augie@google.com>
Wed, 11 Jul 2018 11:34:41 -0400
changeset 38655 cd1c484e31e8
parent 38654 0d27d6bcfb28
child 38656 531f5e933e49
revlog: adjust doctest examples to be portable to Python 3 The range() builtin returns a special object rather than a list, but we really wanted a list in these examples. Differential Revision: https://phab.mercurial-scm.org/D3922
mercurial/revlog.py
--- a/mercurial/revlog.py	Wed Jul 11 13:41:47 2018 -0400
+++ b/mercurial/revlog.py	Wed Jul 11 11:34:41 2018 -0400
@@ -329,7 +329,7 @@
     ...  91, #15 (5)
     ... ])
 
-    >>> list(_slicechunk(revlog, range(16)))
+    >>> list(_slicechunk(revlog, list(range(16))))
     [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]]
     >>> list(_slicechunk(revlog, [0, 15]))
     [[0], [15]]
@@ -460,7 +460,7 @@
     ...  91, #15 (5)
     ... ])
 
-    >>> list(_slicechunktodensity(revlog, range(16)))
+    >>> list(_slicechunktodensity(revlog, list(range(16))))
     [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]]
     >>> list(_slicechunktodensity(revlog, [0, 15]))
     [[0], [15]]