Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #18 from yolesaber/master

Fixed return value of _token_set when given an empty string
  • Loading branch information...
commit e91af7742423831ca0b334638a0e4496737a96db 2 parents 775dfbf + 3b19e0d
@acslater00 acslater00 authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  fuzzywuzzy/fuzz.py
View
2  fuzzywuzzy/fuzz.py
@@ -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))
Please sign in to comment.
Something went wrong with that request. Please try again.