From fea2af1e9b0c99cac6cb8806c4af651a38e92d07 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 4 Jan 1993 09:16:51 +0000 Subject: * More changes due to stricter argument passing rules * Fixed calendar.py, mimetools.py, whrandom.py to cope with time.time() returning a floating point number. (And fix old bug in calendar) * Add recursion level to mainloop.mainloop(), to make it reentrant. --- Lib/calendar.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Lib/calendar.py') diff --git a/Lib/calendar.py b/Lib/calendar.py index 62fb27fb1d..13c8bbbd3f 100644 --- a/Lib/calendar.py +++ b/Lib/calendar.py @@ -31,6 +31,7 @@ error = 'calendar error' # Turn seconds since epoch into calendar time def gmtime(secs): if secs < 0: raise error, 'negative input to gmtime()' + secs = int(secs) mins, secs = divmod(secs, 60) hours, mins = divmod(mins, 60) days, hours = divmod(hours, 24) @@ -146,7 +147,7 @@ def monthcalendar(year, month): key = `year` + month_abbr[month] try: return mc_cache[key] - except IOError: + except KeyError: mc_cache[key] = ret = _monthcalendar(year, month) return ret -- cgit v1.2.1