Patchwork D2323: py3: use range instead on xrange on py3 in tests/test-atomictempfile.py

login
register
mail settings
Submitter phabricator
Date Feb. 18, 2018, 1:29 p.m.
Message ID <differential-rev-PHID-DREV-v7pddvsxbwm4lzef7hby-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28076/
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 available on Python 3.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-atomictempfile.py

CHANGE DETAILS




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

Patch

diff --git a/tests/test-atomictempfile.py b/tests/test-atomictempfile.py
--- a/tests/test-atomictempfile.py
+++ b/tests/test-atomictempfile.py
@@ -7,10 +7,14 @@ 
 import unittest
 
 from mercurial import (
+    pycompat,
     util,
 )
 atomictempfile = util.atomictempfile
 
+if pycompat.ispy3:
+    xrange = range
+
 class testatomictempfile(unittest.TestCase):
     def setUp(self):
         self._testdir = tempfile.mkdtemp('atomictempfiletest')