summaryrefslogtreecommitdiffstats
path: root/bindings
diff options
context:
space:
mode:
authorSerge Guelton <sguelton@quarkslab.com>2018-12-18 08:24:06 +0000
committerSerge Guelton <sguelton@quarkslab.com>2018-12-18 08:24:06 +0000
commit3241c3649e96c7aaf63db8093035208dab3b7e13 (patch)
tree7962c3440a66384f4de700c9e22ac74e9d273945 /bindings
parent08e6d377b981edb4779bd3b24fc75335ba42a308 (diff)
Portable Python script across Python version
Replace `xrange(...)` by either `range(...)` or `list(range(...))` depending on the context. Differential Revision: https://reviews.llvm.org/D55193 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@349448 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings')
-rw-r--r--bindings/python/clang/cindex.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/bindings/python/clang/cindex.py b/bindings/python/clang/cindex.py
index 939213d302..72e8fdb8a8 100644
--- a/bindings/python/clang/cindex.py
+++ b/bindings/python/clang/cindex.py
@@ -109,8 +109,6 @@ if sys.version_info[0] == 3:
return x
return x.encode('utf8')
- xrange = range
-
elif sys.version_info[0] == 2:
# Python 2 strings are utf8 byte strings, no translation is needed for
# C-interop.
@@ -556,7 +554,7 @@ class TokenGroup(object):
token_group = TokenGroup(tu, tokens_memory, tokens_count)
- for i in xrange(0, count):
+ for i in range(0, count):
token = Token()
token.int_data = tokens_array[i].int_data
token.ptr_data = tokens_array[i].ptr_data
@@ -3190,7 +3188,7 @@ class CompileCommand(object):
Invariant : the first argument is the compiler executable
"""
length = conf.lib.clang_CompileCommand_getNumArgs(self.cmd)
- for i in xrange(length):
+ for i in range(length):
yield conf.lib.clang_CompileCommand_getArg(self.cmd, i)
class CompileCommands(object):