diff options
author | Guido van Rossum <guido@python.org> | 1993-01-04 09:16:51 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1993-01-04 09:16:51 (GMT) |
commit | fea2af1e9b0c99cac6cb8806c4af651a38e92d07 (patch) | |
tree | e9e0ec3b003498ab942e1c0b7dd3d28951ca2701 /Lib/calendar.py | |
parent | a2b7f40513ba5d75a2063c3fabe47377cd8c0416 (diff) | |
download | cpython-fea2af1e9b0c99cac6cb8806c4af651a38e92d07.zip cpython-fea2af1e9b0c99cac6cb8806c4af651a38e92d07.tar.gz cpython-fea2af1e9b0c99cac6cb8806c4af651a38e92d07.tar.bz2 |
* 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.
Diffstat (limited to 'Lib/calendar.py')
-rw-r--r-- | Lib/calendar.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/calendar.py b/Lib/calendar.py index 62fb27f..13c8bbb 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 |