summaryrefslogtreecommitdiff
path: root/python/setting.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/setting.py')
-rw-r--r--python/setting.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/python/setting.py b/python/setting.py
index 7cde3865..16d943e7 100644
--- a/python/setting.py
+++ b/python/setting.py
@@ -23,6 +23,9 @@ import ctypes
# Binary Ninja components -- additional imports belong in the appropriate class
from binaryninja import _binaryninjacore as core
+# 2-3 compatibility
+from six.moves import range
+
class Setting(object):
def __init__(self, plugin_name="core"):
@@ -45,7 +48,7 @@ class Setting(object):
default_list[i] = default_value[i]
result = core.BNSettingGetIntegerList(self.plugin_name, name, default_list, ctypes.byref(length))
out_list = []
- for i in xrange(length.value):
+ for i in range(length.value):
out_list.append(result[i])
core.BNFreeSettingIntegerList(result)
return out_list
@@ -58,7 +61,7 @@ class Setting(object):
default_list[i] = default_value[i]
result = core.BNSettingGetStringList(self.plugin_name, name, default_list, ctypes.byref(length))
out_list = []
- for i in xrange(length.value):
+ for i in range(length.value):
out_list.append(result[i])
core.BNFreeStringList(result, length)
return out_list
@@ -100,7 +103,7 @@ class Setting(object):
length = ctypes.c_ulonglong()
length.value = len(value)
default_list = (ctypes.c_longlong * len(value))()
- for i in xrange(len(value)):
+ for i in range(len(value)):
default_list[i] = value[i]
return core.BNSettingSetIntegerList(self.plugin_name, name, default_list, length, auto_flush)
@@ -109,7 +112,7 @@ class Setting(object):
length = ctypes.c_ulonglong()
length.value = len(value)
default_list = (ctypes.c_char_p * len(value))()
- for i in xrange(len(value)):
+ for i in range(len(value)):
default_list[i] = str(value[i])
return core.BNSettingSetStringList(self.plugin_name, name, default_list, length, auto_flush)