Changeset 3216


Ignore:
Timestamp:
Nov 5, 2010 11:39:19 AM (10 years ago)
Author:
jwatson
Message:

Fixing error diagnostic when indexing a variable with a bad index.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pyomo/trunk/coopr/pyomo/base/var.py

    r3166 r3216  
    308308        except KeyError: # thrown if the supplied index is hashable, but not defined.
    309309            msg = "Unknown index '%s' in variable %s;" % (str(ndx), self.name)
    310             if (isinstance(ndx, (tuple, list)) and len(ndx) != self.dim()) or \
    311                    (ndx != self.dim()):
     310            if (isinstance(ndx, (tuple, list)) and len(ndx) != self.dim()):
    312311                msg += "    Expecting %i-dimensional indices" % self.dim()
    313312            else:
Note: See TracChangeset for help on using the changeset viewer.