[fix] PEBCAK

This commit is contained in:
Al
2015-09-27 22:49:27 -04:00
parent 93b3110a49
commit f29f2f091b

View File

@@ -174,14 +174,14 @@ class AddressFormatter(object):
tokens = tokenize_raw(value.strip())
for token_start, token_length, token_type in tokens:
start = token_start
if token_type in (comma, hyphen):
if token_type not in (comma, hyphen):
break
else:
start = token_start + token_length
for token_start, token_length, token_type in reversed(tokens):
end = token_start + token_length
if token_type in (comma, hyphen):
if token_type not in (comma, hyphen):
break
else:
end = token_start