Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Levenshtein distance fallback

  • Loading branch information...
commit a74616200111f72ca4f25751517a599a3598147c 1 parent a187e96
@kelvan authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 gotovienna/realtime.py
View
6 gotovienna/realtime.py
@@ -14,7 +14,11 @@
from cache import Stations
from time import sleep
from utils import sort_departures
-from Levenshtein import distance
+try:
+ from Levenshtein import distance
+except:
+ print "Cannot import Levenshtein.distance, use fallback"
+ distance = lambda x, y: (y*1.0) / x
from gotovienna import defaults
Please sign in to comment.
Something went wrong with that request. Please try again.