diff --git a/auto_sort/asort.py b/auto_sort/asort.py index f8e0bcd..f73eaed 100644 --- a/auto_sort/asort.py +++ b/auto_sort/asort.py @@ -54,7 +54,7 @@ def main(): line = line.strip() items.append(line) # When no more items, blank line or new header - elif line is '\n': + elif line == '\n': # when we meet the next header, we should stop adding new item to the list. for item in sorted(items, key=lambda x: regex.findall(x.upper())[len(regex.findall(x.upper()))-1]): # write the ordered list to the temporary file. diff --git a/auto_sort/asort_es-ES.py b/auto_sort/asort_es-ES.py index da6543e..f566375 100644 --- a/auto_sort/asort_es-ES.py +++ b/auto_sort/asort_es-ES.py @@ -54,7 +54,7 @@ def main(): line = line.strip() items.append(line) # When no more items, blank line or new header - elif line is '\n': + elif line == '\n': # when we meet the next header, we should stop adding new item to the list. for item in sorted(items, key=lambda x: regex.findall(x.upper())[len(regex.findall(x.upper()))-1]): # write the ordered list to the temporary file. diff --git a/auto_sort/asort_zh.py b/auto_sort/asort_zh.py index 24f3e39..9e0a72c 100644 --- a/auto_sort/asort_zh.py +++ b/auto_sort/asort_zh.py @@ -54,7 +54,7 @@ def main(): line = line.strip() items.append(line) # When no more items, blank line or new header - elif line is '\n': + elif line == '\n': # when we meet the next header, we should stop adding new item to the list. for item in sorted(items, key=lambda x: regex.findall(x.upper())[len(regex.findall(x.upper()))-1]): # write the ordered list to the temporary file.