summaryrefslogtreecommitdiff
path: root/python/update.py
diff options
context:
space:
mode:
authorJordan Wiens <jordan@psifertex.com>2018-05-29 14:32:08 -0400
committerRyan Snyder <ryan@vector35.com>2018-07-10 18:11:08 -0400
commit1c03ac08aa94f5bedf21ec8f48ee1ec998e0e50c (patch)
tree0c10026079b3f0a50affb6b5d42cc3684056e5fc /python/update.py
parentd4d1fbb390c9a31045cea8e612c02e242d11c438 (diff)
addition 3 compatibility changes
Diffstat (limited to 'python/update.py')
-rw-r--r--python/update.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/python/update.py b/python/update.py
index 560f05ec..4c77b202 100644
--- a/python/update.py
+++ b/python/update.py
@@ -28,6 +28,7 @@ from binaryninja.enums import UpdateResult
#2-3 compatibility
from six import with_metaclass
+from six.moves import range
class _UpdateChannelMetaClass(type):
@@ -43,7 +44,7 @@ class _UpdateChannelMetaClass(type):
core.BNFreeString(ctypes.cast(errors, ctypes.POINTER(ctypes.c_byte)))
raise IOError(error_str)
result = []
- for i in xrange(0, count.value):
+ for i in range(0, count.value):
result.append(UpdateChannel(channels[i].name, channels[i].description, channels[i].latestVersion))
core.BNFreeUpdateChannelList(channels, count.value)
return result
@@ -66,7 +67,7 @@ class _UpdateChannelMetaClass(type):
core.BNFreeString(ctypes.cast(errors, ctypes.POINTER(ctypes.c_byte)))
raise IOError(error_str)
try:
- for i in xrange(0, count.value):
+ for i in range(0, count.value):
yield UpdateChannel(channels[i].name, channels[i].description, channels[i].latestVersion)
finally:
core.BNFreeUpdateChannelList(channels, count.value)
@@ -87,7 +88,7 @@ class _UpdateChannelMetaClass(type):
core.BNFreeString(ctypes.cast(errors, ctypes.POINTER(ctypes.c_byte)))
raise IOError(error_str)
result = None
- for i in xrange(0, count.value):
+ for i in range(0, count.value):
if channels[i].name == str(name):
result = UpdateChannel(channels[i].name, channels[i].description, channels[i].latestVersion)
break
@@ -130,7 +131,7 @@ class UpdateChannel(with_metaclass(_UpdateChannelMetaClass, object)):
core.BNFreeString(ctypes.cast(errors, ctypes.POINTER(ctypes.c_byte)))
raise IOError(error_str)
result = []
- for i in xrange(0, count.value):
+ for i in range(0, count.value):
result.append(UpdateVersion(self, versions[i].version, versions[i].notes, versions[i].time))
core.BNFreeUpdateChannelVersionList(versions, count.value)
return result
@@ -146,7 +147,7 @@ class UpdateChannel(with_metaclass(_UpdateChannelMetaClass, object)):
core.BNFreeString(ctypes.cast(errors, ctypes.POINTER(ctypes.c_byte)))
raise IOError(error_str)
result = None
- for i in xrange(0, count.value):
+ for i in range(0, count.value):
if versions[i].version == self.latest_version_num:
result = UpdateVersion(self, versions[i].version, versions[i].notes, versions[i].time)
break