Changeset 2914


Ignore:
Timestamp:
Aug 9, 2010 5:29:32 PM (9 years ago)
Author:
prsteel
Message:

Fixes bug in error-catching routine. Previously, errors were raised
via raise some_string', rather than raise some_exception,
some_string'.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pyomo/trunk/coopr/pyomo/preprocess/identify_vars.py

    r2872 r2914  
    139139                    self._identify_variables(Obj[key]._data[ondx].expr, model)
    140140                except ValueError, err:
    141                     raise "Problem processing objective %s (index %s): %s" % (str(key), str(ondx), str(err))
     141                    raise ValueError, "Problem processing objective %s (index %s): %s" % (str(key), str(ondx), str(err))
    142142
    143143                Obj[key]._data[ondx].id = self.onum
     
    152152                    self._identify_variables(C._data[cndx].body, model)
    153153                except ValueError, err:
    154                     raise "Problem processing constraint %s (index %s): %s" % (str(key), str(cndx), str(err))
     154                    raise ValueError, "Problem processing constraint %s (index %s): %s" % (str(key), str(cndx), str(err))
    155155                C._data[cndx].id = self.cnum
    156156                model._con[self.cnum] = C._data[cndx]
Note: See TracChangeset for help on using the changeset viewer.