From bec7332eea067d20fa7dc8e4074ae2a232962d5d Mon Sep 17 00:00:00 2001 From: tqchen Date: Sun, 6 Mar 2016 20:54:27 -0800 Subject: [PATCH] Fix rabit --- python-package/xgboost/rabit.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python-package/xgboost/rabit.py b/python-package/xgboost/rabit.py index 0ea7736e5..7c6a9dbcf 100644 --- a/python-package/xgboost/rabit.py +++ b/python-package/xgboost/rabit.py @@ -9,9 +9,10 @@ from .core import _LIB, c_str, STRING_TYPES def _init_rabit(): """internal libary initializer.""" - _LIB.RabitGetRank.restype = ctypes.c_int - _LIB.RabitGetWorldSize.restype = ctypes.c_int - _LIB.RabitVersionNumber.restype = ctypes.c_int + if _LIB is not None: + _LIB.RabitGetRank.restype = ctypes.c_int + _LIB.RabitGetWorldSize.restype = ctypes.c_int + _LIB.RabitVersionNumber.restype = ctypes.c_int def init(args=None): """Initialize the rabit libary with arguments"""