# HG changeset patch # User Gregory Szorc # Date 2018-08-01 19:57:15 # Node ID 7eba8f83129bc0642d19ee72ae335d0d1846803e # Parent 0a57945aaf7f80438086e1c414ff3b9ec06266d8 pycompat: add xrange alias for Python 2 We assign xrange on Python 3 but not Python 2. Adding the missing symbol on Python 2 allows us to use `pycompat.xrange` to get a generator range function. Differential Revision: https://phab.mercurial-scm.org/D4031 diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py --- a/mercurial/pycompat.py +++ b/mercurial/pycompat.py @@ -331,6 +331,7 @@ if ispy3: else: import cStringIO + xrange = xrange unicode = unicode bytechr = chr byterepr = repr