py3: use range instead on xrange on py3 in tests/test-atomictempfile.py
authorPulkit Goyal <7895pulkit@gmail.com>
Sun, 18 Feb 2018 17:41:56 +0530
changeset 36285 3ec9afb951a0
parent 36284 d157b5bfaef0
child 36286 daa5f47558cf
py3: use range instead on xrange on py3 in tests/test-atomictempfile.py xrange is not available on Python 3. Differential Revision: https://phab.mercurial-scm.org/D2323
tests/test-atomictempfile.py
--- a/tests/test-atomictempfile.py	Sun Feb 18 17:37:47 2018 +0530
+++ b/tests/test-atomictempfile.py	Sun Feb 18 17:41:56 2018 +0530
@@ -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')