[Python-checkins] r42135 - sandbox/trunk/pycon/parse-sched.py

andrew.kuchling python-checkins at python.org
Sat Jan 21 15:14:16 CET 2006


Author: andrew.kuchling
Date: Sat Jan 21 15:14:16 2006
New Revision: 42135

Modified:
   sandbox/trunk/pycon/parse-sched.py
Log:
Change #! line; fix bug in determining row span (code would walk off the end of the list)

Modified: sandbox/trunk/pycon/parse-sched.py
==============================================================================
--- sandbox/trunk/pycon/parse-sched.py	(original)
+++ sandbox/trunk/pycon/parse-sched.py	Sat Jan 21 15:14:16 2006
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 # Reads a page with a wiki-format table
 
@@ -93,8 +93,11 @@
     if len(time_list) == 0:
         return 1
     span = 0
-    while (time_list[span][0] < end_time and span < len(time_list)):
+    while (span < len(time_list) and 
+	   (time_list[span][0] < end_time and span < len(time_list))):
         span += 1
+    if span == len(time_list):
+        return 1
     return span+1
     
     


More information about the Python-checkins mailing list