Changing dict construction syntax to work with Python 2.6

This commit is contained in:
Ryan J. O'Neil 2015-12-29 08:15:11 -05:00
parent fdb518b76a
commit 4448335671
1 changed files with 3 additions and 1 deletions

View File

@ -1152,7 +1152,9 @@ class LpProblem(object):
def __setstate__(self, state):
# Update transient data prior to unpickling.
self.__dict__.update(state)
self._variable_ids = {id(v): v for v in self._variables}
self._variable_ids = {}
for v in self._variables:
self._variable_ids[id(v)] = v
def copy(self):
"""Make a copy of self. Expressions are copied by reference"""