summaryrefslogtreecommitdiff
path: root/paste/util/datetimeutil.py
diff options
context:
space:
mode:
authorcce <devnull@localhost>2006-08-24 19:02:00 +0000
committercce <devnull@localhost>2006-08-24 19:02:00 +0000
commit003b2349cce5d08dcc25cc6426037535a782ce9f (patch)
tree50a3b9d52b8d0e266ce683ee04c6a82a3eac6558 /paste/util/datetimeutil.py
parentfd282fd13bd80f17c370e9626025b63d896ae339 (diff)
downloadpaste-003b2349cce5d08dcc25cc6426037535a782ce9f.tar.gz
- raise type error on unknown months
- allow 'today' as keyword date
Diffstat (limited to 'paste/util/datetimeutil.py')
-rw-r--r--paste/util/datetimeutil.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/paste/util/datetimeutil.py b/paste/util/datetimeutil.py
index 57be752..6df3993 100644
--- a/paste/util/datetimeutil.py
+++ b/paste/util/datetimeutil.py
@@ -181,7 +181,7 @@ def _month(val):
for (key,mon) in _str2num.items():
if key in val:
return mon
- return None
+ raise TypeError("unknown month '%s'" % val)
_days_in_month = {1:31,2:28,3:31,4:30,5:31,6:30,
7:31,8:31,9:30,10:31,11:30,12:31 }
@@ -212,7 +212,7 @@ def parse_date(val):
# allow for 'now', 'mon', 'tue', etc.
if not now:
chk = val[:3]
- if 'now' == chk:
+ if chk in ('now','tod'):
now = date.today()
elif chk in _wkdy:
now = date.today()