Revision 6214
Added by Aaron Marcuse-Kubitza about 12 years ago
schemas/py_functions.sql | ||
---|---|---|
80 | 80 |
except ValueError: |
81 | 81 |
try: date = strtotime(str_) |
82 | 82 |
except ImportError: return str_ |
83 |
except ValueError, e: raise_invalid_value(e, str_)
|
|
83 |
except ValueError as e: raise_invalid_value(e, str_)
|
|
84 | 84 |
else: date = (datetime.date(int(year), 1, 1) + |
85 | 85 |
datetime.timedelta(round((year % 1.)*365))) |
86 | 86 |
else: |
... | ... | |
102 | 102 |
try: |
103 | 103 |
date = datetime.date(year, month, day) |
104 | 104 |
break |
105 |
except ValueError, e:
|
|
105 |
except ValueError as e:
|
|
106 | 106 |
if try_num > 0: raise # exception still raised after retry |
107 | 107 |
msg = e_msg(e) |
108 | 108 |
if msg == 'month must be in 1..12': # try swapping month and day |
Also available in: Unified diff
schemas/py_functions.sql: Updated except clause syntax for PostgreSQL 9.1.6