From 936fc791b6d8377af1f8bfd428e6bed80b380a53 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Thu, 21 Jun 2001 23:55:59 +0000 Subject: [PATCH] Try to trap a bug svn: r174 --- src/Date.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Date.py b/src/Date.py index bc3631a59..f5f59042d 100644 --- a/src/Date.py +++ b/src/Date.py @@ -355,7 +355,11 @@ class SingleDate: # #-------------------------------------------------------------------- def setMonth(self,val): - self.month = val - 1 + if val > 12: + self.month = -1 + print "Bad month index : %d" % val + else: + self.month = val - 1 #-------------------------------------------------------------------- # @@ -549,7 +553,7 @@ class SingleDate: elif self.year == -1: month = SingleDate.mname[self.month] retval = string.upper(month[0:3]) - else: + else: month = SingleDate.mname[self.month] retval = "%s %d" % (string.upper(month[0:3]),self.year) elif self.month == -1: