diff options
| author | Jordan Wiens <jordan@psifertex.com> | 2018-05-29 14:32:08 -0400 |
|---|---|---|
| committer | Ryan Snyder <ryan@vector35.com> | 2018-07-10 18:11:08 -0400 |
| commit | 1c03ac08aa94f5bedf21ec8f48ee1ec998e0e50c (patch) | |
| tree | 0c10026079b3f0a50affb6b5d42cc3684056e5fc /python/scriptingprovider.py | |
| parent | d4d1fbb390c9a31045cea8e612c02e242d11c438 (diff) | |
addition 3 compatibility changes
Diffstat (limited to 'python/scriptingprovider.py')
| -rw-r--r-- | python/scriptingprovider.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/python/scriptingprovider.py b/python/scriptingprovider.py index 0b15ee18..374b2f41 100644 --- a/python/scriptingprovider.py +++ b/python/scriptingprovider.py @@ -33,6 +33,7 @@ import binaryninja.log #2-3 compatibility from six import with_metaclass +from six.moves import range class _ThreadActionContext(object): @@ -263,7 +264,7 @@ class _ScriptingProviderMetaclass(type): count = ctypes.c_ulonglong() types = core.BNGetScriptingProviderList(count) result = [] - for i in xrange(0, count.value): + for i in range(0, count.value): result.append(ScriptingProvider(types[i])) core.BNFreeScriptingProviderList(types) return result @@ -273,7 +274,7 @@ class _ScriptingProviderMetaclass(type): count = ctypes.c_ulonglong() types = core.BNGetScriptingProviderList(count) try: - for i in xrange(0, count.value): + for i in range(0, count.value): yield ScriptingProvider(types[i]) finally: core.BNFreeScriptingProviderList(types) @@ -313,7 +314,7 @@ class ScriptingProvider(with_metaclass(_ScriptingProviderMetaclass, object)): self._cb = core.BNScriptingProviderCallbacks() self._cb.context = 0 self._cb.createInstance = self._cb.createInstance.__class__(self._create_instance) - self.handle = core.BNRegisterScriptingProvider(self.__class__.name.encode('utf8'), self._cb) + self.handle = core.BNRegisterScriptingProvider(self.__class__.name, self._cb) self.__class__._registered_providers.append(self) def _create_instance(self, ctxt): |
