A fix regarding the compatibility with python 2.6 (#1981)

* A fix regarding the compatibility with python 2.6

the syntax of {n: self.attr(n) for n in attr_names} is illegal in python 2.6

* Update core.py

add a space after comma
This commit is contained in:
yexu15 2017-01-29 20:18:28 -08:00 committed by Tianqi Chen
parent 5d74578095
commit 179b384e39

View File

@ -762,7 +762,7 @@ class Booster(object):
ctypes.byref(length),
ctypes.byref(sarr)))
attr_names = from_cstr_to_pystr(sarr, length)
res = {n: self.attr(n) for n in attr_names}
res = dict([(n, self.attr(n)) for n in attr_names])
return res
def set_attr(self, **kwargs):