From fcac956e5e5090bfd5c74b4849c8476d333c54a4 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Wed, 30 Sep 2020 16:59:18 +0300 Subject: [PATCH] Use ctypes for parameters of DLL functions for Dataset --- python-package/lightgbm/basic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python-package/lightgbm/basic.py b/python-package/lightgbm/basic.py index 461850c4e869..c039ae3eafed 100644 --- a/python-package/lightgbm/basic.py +++ b/python-package/lightgbm/basic.py @@ -1731,9 +1731,9 @@ def get_feature_name(self): ptr_string_buffers = (ctypes.c_char_p * num_feature)(*map(ctypes.addressof, string_buffers)) _safe_call(_LIB.LGBM_DatasetGetFeatureNames( 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: