From b7a0c06bff0d0e3d525e580d21011492f2c4bfc2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 27 Jan 2011 10:43:24 -0700 Subject: [PATCH] ... --- src/calibre/ebooks/metadata/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/metadata/__init__.py b/src/calibre/ebooks/metadata/__init__.py index 847d69597c..fcd4491fd3 100644 --- a/src/calibre/ebooks/metadata/__init__.py +++ b/src/calibre/ebooks/metadata/__init__.py @@ -36,7 +36,7 @@ def author_to_author_sort(author): return author author = _bracket_pat.sub('', author).strip() tokens = author.split() - if tokens[-1] not in ('Inc.', 'Inc'): + if tokens and tokens[-1] not in ('Inc.', 'Inc'): tokens = tokens[-1:] + tokens[:-1] if len(tokens) > 1 and method != 'nocomma': tokens[0] += ','