Changeset 4261

Show
Ignore:
Timestamp:
07/09/08 13:48:53 (1 month ago)
Author:
paul
Message:

[4183] introduced the incorrect error class in the try: block. We should be
checking for ValueError? from time.strptime(), not IndexError?.

Files:

Legend:

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

    r4260 r4261  
    147147            try: 
    148148                ret = datetime.date(*time.strptime(strVal, "%x")[:3]) 
    149             except IndexError: 
     149            except ValueError:  ## ValueError from time.strptime() 
    150150                pass 
    151151    return ret 
     
    218218            try: 
    219219                ret = datetime.datetime(*time.strptime(strVal, "%x %X")[:7]) 
    220             except IndexError: 
     220            except ValueError:  ## ValueError from time.strptime() 
    221221                pass 
    222222    return ret