Merged revisions 78757 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r78757 | florent.xicluna | 2010-03-07 14:14:25 +0200 (Sun, 07 Mar 2010) | 2 lines

  Fix some py3k warnings in the standard library.
........
diff --git a/Lib/calendar.py b/Lib/calendar.py
index ab14c7d..2e45e24 100644
--- a/Lib/calendar.py
+++ b/Lib/calendar.py
@@ -564,6 +564,10 @@
 firstweekday = c.getfirstweekday
 
 def setfirstweekday(firstweekday):
+    try:
+        firstweekday.__index__
+    except AttributeError:
+        raise IllegalWeekdayError(firstweekday)
     if not MONDAY <= firstweekday <= SUNDAY:
         raise IllegalWeekdayError(firstweekday)
     c.firstweekday = firstweekday