From d1219ea565869ddd7147aaabe8a7852a08f0e923 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 18 Jan 2020 13:01:33 +0100 Subject: [PATCH] Handle inflex pluralization errror on complex object name. Resolves #2015. --- evennia/objects/objects.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/evennia/objects/objects.py b/evennia/objects/objects.py index bc9f946415..d980b88303 100644 --- a/evennia/objects/objects.py +++ b/evennia/objects/objects.py @@ -341,8 +341,12 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase): """ key = kwargs.get("key", self.key) key = ansi.ANSIString(key) # this is needed to allow inflection of colored names - plural = _INFLECT.plural(key, 2) - plural = "%s %s" % (_INFLECT.number_to_words(count, threshold=12), plural) + try: + plural = _INFLECT.plural(key, 2) + plural = "%s %s" % (_INFLECT.number_to_words(count, threshold=12), plural) + except IndexError: + # this is raised by inflect if the input is not a proper noun + plural = key singular = _INFLECT.an(key) if not self.aliases.get(plural, category="plural_key"): # we need to wipe any old plurals/an/a in case key changed in the interrim