changeset 1732:8717df0c789c

merge
author Roger Haase <crosseyedpenguin@yahoo.com>
date Thu, 23 Aug 2012 13:45:49 -0700
parents e79b4f4df123 (current diff) 025bf5e65246 (diff)
children 0ee32cdd84d8
files MoinMoin/apps/frontend/views.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/apps/frontend/views.py	Thu Aug 23 08:02:36 2012 +0200
+++ b/MoinMoin/apps/frontend/views.py	Thu Aug 23 13:45:49 2012 -0700
@@ -1770,6 +1770,8 @@
     :rtype: list
     :returns: list of matching item names, sorted by rank
     """
+    if not item_names:
+        return []
     # Match using case insensitive matching
     # Make mapping from lower item names to item names.
     lower = {}
@@ -1782,7 +1784,7 @@
 
     # Get all close matches
     all_matches = difflib.get_close_matches(item_name.lower(), lower.keys(),
-                                            len(lower), cutoff=0.6)
+                                            n=len(lower), cutoff=0.6)
 
     # Replace lower names with original names
     matches = []