Changeset 2888


Ignore:
Timestamp:
Jul 29, 2010 7:53:47 PM (9 years ago)
Author:
prsteel
Message:

Updated logic for partial function for Python 2.4 and older.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pyomo/trunk/coopr/pyomo/transform/util.py

    r2879 r2888  
    225225        def closure(*cargs, **ckwds):
    226226            # Collect positional arguments
    227             cargs = list(cargs)
    228             cargs.extend(args)
    229 
    230             # Update keyword arguments
    231             for (k, v) in kwds.items():
    232                 if k not in ckwds:
    233                     ckwds[k] = v
     227            tmp_args = list(args)
     228            tmp_args.extend(list(cargs))
     229
     230            tmp_kwds = dict(kwds)
     231            tmp_kwds.update(ckwds)
    234232
    235233            # Call the original function
    236             return f(*cargs, **ckwds)
     234            return f(*tmp_args, **tmp_kwds)
    237235        return closure
    238236
Note: See TracChangeset for help on using the changeset viewer.