Exemplo n.º 1
0
	def _create_instance(self, ctxt):
		try:
			result = self.__class__.instance_class(self)
			if result is None:
				return None
			return ctypes.cast(core.BNNewDownloadInstanceReference(result.handle), ctypes.c_void_p).value
		except:
			log.log_error(traceback.format_exc())
			return None
Exemplo n.º 2
0
 def _create_instance(self, ctxt):
     try:
         assert self.__class__.instance_class is not None, "instance_class is None"
         result = self.__class__.instance_class(self)
         if result is None:
             return None
         download_instance = core.BNNewDownloadInstanceReference(
             result.handle)
         assert download_instance is not None, "core.BNNewDownloadInstanceReference returned None"
         return ctypes.cast(download_instance, ctypes.c_void_p).value
     except:
         log_error(traceback.format_exc())
         return None