Commit b77ec47f authored by Sergio Callegari's avatar Sergio Callegari

Assure that variable size is int

parent cf38462a
......@@ -842,10 +842,12 @@ class Problem(object):
if name in self.variables:
raise Exception('this variable already exists')
if isinstance(size,int):
size=(size,1)
if isinstance(size,six.integer_types):
size=(int(size),1)
else:
size=tuple(int(x) for x in size)
if len(size)==1:
size=(size[0],1)
size=(int(size[0]),1)
lisname = None
if '[' in name and ']' in name:#list or dict of variables
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment