Changeset 4242

Show
Ignore:
Timestamp:
07/07/08 06:28:11 (5 months ago)
Author:
ed
Message:

Fixed a problem reported by Uwe Grauer with values for int-type properties being stored in a float format.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dabo/dObject.py

    r4238 r4242  
    6161                typ = type(getattr(self, prop)) 
    6262                if not issubclass(typ, basestring): 
    63                     val = typ(val) 
     63                    try: 
     64                        val = typ(val) 
     65                    except ValueError, e: 
     66                        # Sometimes int values can be stored as floats 
     67                        if typ in (int, long): 
     68                            val = float(val) 
     69                        else: 
     70                            raise e 
    6471                properties[prop] = val 
    6572