Permalink
Browse files

Fixed bug in _token_set

  • Loading branch information...
1 parent 775dfbf commit 3b19e0d4e65a952d960585343798f5c0e37f11e6 @xraymemory xraymemory committed Mar 4, 2013
Showing with 2 additions and 0 deletions.
  1. +2 −0 fuzzywuzzy/fuzz.py
View
@@ -128,6 +128,8 @@ def _token_set(s1, s2, partial=True):
if s1 is None: raise TypeError("s1 is None")
if s2 is None: raise TypeError("s2 is None")
+ if not (validate_string(s1) and validate_string(s2)): return 0
+
# pull tokens
tokens1 = set(REG_TOKEN.findall(s1))
tokens2 = set(REG_TOKEN.findall(s2))

0 comments on commit 3b19e0d

Please sign in to comment.