From e85ff125fb963d38d7e85bd36dc0296ee99610d8 Mon Sep 17 00:00:00 2001 From: davewiththenicehat <54369722+davewiththenicehat@users.noreply.github.com> Date: Thu, 10 Sep 2020 08:29:23 -0400 Subject: [PATCH] gendersub msg method removed positional argument `text` in the msg method of GenderSub is a positional argument causing it to not function as expected in regard to projects documentation on the DefaultObject.msg method. This changes text to being an optional kwarg. --- evennia/contrib/gendersub.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/evennia/contrib/gendersub.py b/evennia/contrib/gendersub.py index ec8a14f7ee..7a1fde2069 100644 --- a/evennia/contrib/gendersub.py +++ b/evennia/contrib/gendersub.py @@ -120,7 +120,7 @@ class GenderCharacter(DefaultCharacter): pronoun = _GENDER_PRONOUN_MAP[gender][typ.lower()] return pronoun.capitalize() if typ.isupper() else pronoun - def msg(self, text, from_obj=None, session=None, **kwargs): + def msg(self, text=None, from_obj=None, session=None, **kwargs): """ Emits something to a session attached to the object. Overloads the default msg() implementation to include @@ -141,6 +141,10 @@ class GenderCharacter(DefaultCharacter): All extra kwargs will be passed on to the protocol. """ + if text is None: + super().msg(from_obj=from_obj, session=session, **kwargs) + return + try: if text and isinstance(text, tuple): text = (_RE_GENDER_PRONOUN.sub(self._get_pronoun, text[0]), *text[1:])