Patchwork D2324: py3: use range instead of xrange on py3 in tests/test-filecache.py

login
register
mail settings
Submitter phabricator
Date Feb. 18, 2018, 1:29 p.m.
Message ID <differential-rev-PHID-DREV-crpa537ippxtrc4ueprn-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28077/
State Superseded
Headers show

Comments

phabricator - Feb. 18, 2018, 1:29 p.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  xrange is not present on py3.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2324

AFFECTED FILES
  tests/test-filecache.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-filecache.py b/tests/test-filecache.py
--- a/tests/test-filecache.py
+++ b/tests/test-filecache.py
@@ -11,11 +11,15 @@ 
     extensions,
     hg,
     localrepo,
+    pycompat,
     ui as uimod,
     util,
     vfs as vfsmod,
 )
 
+if pycompat.ispy3:
+    xrange = range
+
 class fakerepo(object):
     def __init__(self):
         self._filecache = {}