Fix wrong log error in interactive decorator

This commit is contained in:
Griatch 2023-03-25 17:41:49 +01:00
parent 92061c8299
commit 55822654fe

View file

@ -34,13 +34,12 @@ from django.core.validators import validate_email as django_validate_email
from django.utils import timezone
from django.utils.html import strip_tags
from django.utils.translation import gettext as _
from evennia.utils import logger
from simpleeval import simple_eval
from twisted.internet import reactor, threads
from twisted.internet.defer import returnValue # noqa - used as import target
from twisted.internet.task import deferLater
from evennia.utils import logger
_MULTIMATCH_TEMPLATE = settings.SEARCH_MULTIMATCH_TEMPLATE
_EVENNIA_DIR = settings.EVENNIA_DIR
_GAME_DIR = settings.GAME_DIR
@ -2556,12 +2555,14 @@ def interactive(func):
elif isinstance(value, str):
if not caller:
raise ValueError(
"To retrieve input from a @pausable method, that method "
"must be called with a 'caller' argument)"
"To use `result yield('prompt')` in an @interactive method, that "
"method must have an argument named `caller`.)"
)
get_input(caller, value, _process_input, generator=generator)
else:
raise ValueError("yield(val) in a @pausable method must have an int/float as arg.")
raise ValueError(
"yield(val) in an @interactive method must have an int/float as arg."
)
def decorator(*args, **kwargs):
argnames = inspect.getfullargspec(func).args