changeset 38784:882ef6949bdc

check-code: ban use of bare xrange() We want everyone to use pycompat.xrange(). Differential Revision: https://phab.mercurial-scm.org/D4033
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 01 Aug 2018 13:08:00 -0700
parents e7aa113b14f7
children fb9121ea38c4
files contrib/check-code.py
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/check-code.py	Wed Aug 01 13:00:45 2018 -0700
+++ b/contrib/check-code.py	Wed Aug 01 13:08:00 2018 -0700
@@ -511,6 +511,7 @@
     (r'getopt\.getopt', "use pycompat.getoptb instead (py3)"),
     (r'os\.getenv', "use encoding.environ.get instead"),
     (r'os\.setenv', "modifying the environ dict is not preferred"),
+    (r'(?<!pycompat\.)xrange', "use pycompat.xrange instead (py3)"),
   ],
   # warnings
   [],