From 0bca4c8c3b7bb6bb1c3e00a11cf29566d3f8d013 Mon Sep 17 00:00:00 2001 From: Jamie Hall Date: Sat, 19 Sep 2015 10:46:57 +1000 Subject: [PATCH] Restore Python3 compatibility --- python-package/setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python-package/setup.py b/python-package/setup.py index 1c5a257b6..443b2b571 100644 --- a/python-package/setup.py +++ b/python-package/setup.py @@ -22,10 +22,10 @@ CURRENT_DIR = os.path.dirname(__file__) # We can not import `xgboost.libpath` in setup.py directly since xgboost/__init__.py # import `xgboost.core` and finally will import `numpy` and `scipy` which are setup -# `install_requires`. That's why using `execfile` here. +# `install_requires`. That's why we're using `exec` here. libpath_py = os.path.join(CURRENT_DIR, 'xgboost/libpath.py') libpath = {'__file__': libpath_py} -execfile(libpath_py, libpath, libpath) +exec(compile(open(libpath_py, "rb").read(), libpath_py, 'exec'), libpath, libpath) LIB_PATH = libpath['find_lib_path']() #print LIB_PATH