From 1c03ac08aa94f5bedf21ec8f48ee1ec998e0e50c Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Tue, 29 May 2018 14:32:08 -0400 Subject: addition 3 compatibility changes --- python/plugin.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'python/plugin.py') diff --git a/python/plugin.py b/python/plugin.py index 4cf6fb77..52feced4 100644 --- a/python/plugin.py +++ b/python/plugin.py @@ -30,6 +30,7 @@ from binaryninja.enums import PluginCommandType #2-3 compatibility from six import with_metaclass +from six.moves import range class PluginCommandContext(object): @@ -49,7 +50,7 @@ class _PluginCommandMetaClass(type): count = ctypes.c_ulonglong() commands = core.BNGetAllPluginCommands(count) result = [] - for i in xrange(0, count.value): + for i in range(0, count.value): result.append(PluginCommand(commands[i])) core.BNFreePluginCommandList(commands) return result @@ -59,7 +60,7 @@ class _PluginCommandMetaClass(type): count = ctypes.c_ulonglong() commands = core.BNGetAllPluginCommands(count) try: - for i in xrange(0, count.value): + for i in range(0, count.value): yield PluginCommand(commands[i]) finally: core.BNFreePluginCommandList(commands) @@ -568,7 +569,7 @@ class _BackgroundTaskMetaclass(type): count = ctypes.c_ulonglong() tasks = core.BNGetRunningBackgroundTasks(count) result = [] - for i in xrange(0, count.value): + for i in range(0, count.value): result.append(BackgroundTask(handle=core.BNNewBackgroundTaskReference(tasks[i]))) core.BNFreeBackgroundTaskList(tasks, count.value) return result @@ -578,7 +579,7 @@ class _BackgroundTaskMetaclass(type): count = ctypes.c_ulonglong() tasks = core.BNGetRunningBackgroundTasks(count) try: - for i in xrange(0, count.value): + for i in range(0, count.value): yield BackgroundTask(handle=core.BNNewBackgroundTaskReference(tasks[i])) finally: core.BNFreeBackgroundTaskList(tasks, count.value) -- cgit v1.3.1