Skip to content

Commit ae83416

Browse files
committed
api: remove some lingering xrange uses in python bindings
1 parent d8a12bb commit ae83416

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

python/binaryview.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ def analysis_info(self):
983983
info_ref = core.BNGetAnalysisInfo(self.handle)
984984
info = info_ref[0]
985985
active_info_list = []
986-
for i in xrange(0, info.count):
986+
for i in range(0, info.count):
987987
func = binaryninja.function.Function(self, core.BNNewFunctionReference(info.activeInfo[i].func))
988988
active_info = ActiveAnalysisInfo(func, info.activeInfo[i].analysisTime, info.activeInfo[i].updateCount, info.activeInfo[i].submitCount)
989989
active_info_list.append(active_info)

python/downloadprovider.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
# 2-3 compatibility
3737
from binaryninja import pyNativeStr
38+
from binaryninja import range
3839

3940

4041
class DownloadInstance(object):
@@ -85,7 +86,7 @@ def list(self):
8586
count = ctypes.c_ulonglong()
8687
types = core.BNGetDownloadProviderList(count)
8788
result = []
88-
for i in xrange(0, count.value):
89+
for i in range(0, count.value):
8990
result.append(DownloadProvider(types[i]))
9091
core.BNFreeDownloadProviderList(types)
9192
return result
@@ -95,7 +96,7 @@ def __iter__(self):
9596
count = ctypes.c_ulonglong()
9697
types = core.BNGetDownloadProviderList(count)
9798
try:
98-
for i in xrange(0, count.value):
99+
for i in range(0, count.value):
99100
yield DownloadProvider(types[i])
100101
finally:
101102
core.BNFreeDownloadProviderList(types)

python/interaction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ def __getitem__(self, i):
587587

588588
def __iter__(self):
589589
count = len(self)
590-
for i in xrange(0, count):
590+
for i in range(0, count):
591591
yield self._report_from_index(i)
592592

593593
def __repr__(self):

0 commit comments

Comments
 (0)