Project

General

Profile

« Previous | Next » 

Revision 1536

xml_func.py: _date: On error "month must be in 1..12", try swapping month and day

View differences:

lib/xml_func.py
262 262
                date = datetime.date(**items)
263 263
                break
264 264
            except ValueError, e:
265
                if try_num > 0: raise SyntaxException(e)
266
                    # exception still raised after retry
265 267
                msg = str(e)
266 268
                if msg == 'month must be in 1..12': # try swapping month and day
267 269
                    items['month'], items['day'] = items['day'], items['month']

Also available in: Unified diff