python2.5 compatibility enhancement
authorFlorian Schweikert <kelvan@logic.at>
Mon, 31 Oct 2011 14:38:32 +0000 (15:38 +0100)
committerFlorian Schweikert <kelvan@logic.at>
Mon, 31 Oct 2011 14:38:32 +0000 (15:38 +0100)
using simplejson if json not available

gotovienna/cache.py
gotovienna/realtime.py

index eae95b1..a0c2000 100644 (file)
@@ -1,5 +1,8 @@
 from os import path
-import json
+try:
+    import json
+except ImportError:
+    import simplejson as json
 import shutil
 import defaults
 import realtime
index 3884abf..8e665e3 100644 (file)
@@ -181,7 +181,7 @@ class ITipParser:
 
         # open url for 90 min timeslot / get departure for next 90 min
         retry = 0
-        tries = 2
+        tries = 2 # try a second time before return empty list
         while retry < tries:
             bs = BeautifulSoup(urlopen(url + "&departureSizeTimeSlot=90"))
             try: