From f60c14f1f31c34cc7645739c503266516898cae9 Mon Sep 17 00:00:00 2001 From: Belinda Trotta Date: Wed, 30 Sep 2020 16:07:17 +1000 Subject: [PATCH] Use ctypes for parameters of DLL functions (#3419) --- python-package/lightgbm/basic.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python-package/lightgbm/basic.py b/python-package/lightgbm/basic.py index 714d8fed7536..461850c4e869 100644 --- a/python-package/lightgbm/basic.py +++ b/python-package/lightgbm/basic.py @@ -2976,9 +2976,9 @@ def feature_name(self): ptr_string_buffers = (ctypes.c_char_p * num_feature)(*map(ctypes.addressof, string_buffers)) _safe_call(_LIB.LGBM_BoosterGetFeatureNames( self.handle, - num_feature, + ctypes.c_int(num_feature), ctypes.byref(tmp_out_len), - reserved_string_buffer_size, + ctypes.c_size_t(reserved_string_buffer_size), ctypes.byref(required_string_buffer_size), ptr_string_buffers)) if num_feature != tmp_out_len.value: @@ -3175,9 +3175,9 @@ def __get_eval_info(self): ptr_string_buffers = (ctypes.c_char_p * self.__num_inner_eval)(*map(ctypes.addressof, string_buffers)) _safe_call(_LIB.LGBM_BoosterGetEvalNames( self.handle, - self.__num_inner_eval, + ctypes.c_int(self.__num_inner_eval), ctypes.byref(tmp_out_len), - reserved_string_buffer_size, + ctypes.c_size_t(reserved_string_buffer_size), ctypes.byref(required_string_buffer_size), ptr_string_buffers)) if self.__num_inner_eval != tmp_out_len.value: