From bdedaab8d1ab55f69f940c40f11baf38cd665c29 Mon Sep 17 00:00:00 2001 From: Jiaming Yuan Date: Fri, 19 Feb 2021 11:53:27 +0800 Subject: [PATCH] Fix pylint. (#6714) --- python-package/xgboost/core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python-package/xgboost/core.py b/python-package/xgboost/core.py index 3f2d00278..015988f9a 100644 --- a/python-package/xgboost/core.py +++ b/python-package/xgboost/core.py @@ -1118,7 +1118,7 @@ class DeviceQuantileDMatrix(DMatrix): ctypes.c_int(self.max_bin), ctypes.byref(handle), ) - if it.exception: + if it.exception is not None: raise it.exception # delay check_call to throw intermediate exception first _check_call(ret) @@ -1315,7 +1315,7 @@ class Booster(object): self.handle, ctypes.byref(length), ctypes.byref(json_string))) - json_string = json_string.value.decode() + json_string = json_string.value.decode() # NOLINT return json_string def load_config(self, config): @@ -1508,7 +1508,7 @@ class Booster(object): dmats, evnames, c_bst_ulong(len(evals)), ctypes.byref(msg))) - res = msg.value.decode() + res = msg.value.decode() # NOLINT if feval is not None: for dmat, evname in evals: feval_ret = feval(self.predict(dmat, training=False,