From 96ddf39b5bf12f4cad4c8ce577fe2b0d76b44620 Mon Sep 17 00:00:00 2001 From: 0xDEADFED5 Date: Fri, 7 Feb 2025 14:35:11 -0800 Subject: [PATCH] returnValue() deprecated --- evennia/commands/cmdhandler.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/evennia/commands/cmdhandler.py b/evennia/commands/cmdhandler.py index b0851523cc..be6b9bef1f 100644 --- a/evennia/commands/cmdhandler.py +++ b/evennia/commands/cmdhandler.py @@ -37,7 +37,7 @@ from weakref import WeakValueDictionary from django.conf import settings from django.utils.translation import gettext as _ from twisted.internet import reactor -from twisted.internet.defer import inlineCallbacks, returnValue +from twisted.internet.defer import inlineCallbacks from twisted.internet.task import deferLater from evennia.commands.cmdset import CmdSet @@ -390,7 +390,7 @@ def get_and_merge_cmdsets( # explicitly. cset.old_duplicates = cset.duplicates cset.duplicates = True if cset.duplicates is None else cset.duplicates - returnValue(local_obj_cmdsets) + return local_obj_cmdsets except Exception: _msg_err(caller, _ERROR_CMDSETS) raise ErrorReported(raw_string) @@ -408,9 +408,9 @@ def get_and_merge_cmdsets( _msg_err(caller, _ERROR_CMDSETS) raise ErrorReported(raw_string) try: - returnValue(obj.get_cmdsets(caller=caller, current=current)) + return obj.get_cmdsets(caller=caller, current=current) except AttributeError: - returnValue((CmdSet(), [])) + return (CmdSet(), []) local_obj_cmdsets = [] @@ -486,7 +486,7 @@ def get_and_merge_cmdsets( # if cmdset: # caller.cmdset.current = cmdset - returnValue(cmdset) + return cmdset except ErrorReported: raise except Exception: @@ -600,7 +600,7 @@ def cmdhandler( if _testing: # only return the command instance - returnValue(cmd) + return cmd # assign custom kwargs to found cmd object for key, val in kwargs.items(): @@ -619,7 +619,7 @@ def cmdhandler( abort = yield cmd.at_pre_cmd() if abort: # abort sequence - returnValue(abort) + return abort # Parse and execute yield cmd.parse() @@ -649,7 +649,7 @@ def cmdhandler( caller.ndb.last_cmd = None # return result to the deferred - returnValue(ret) + return ret except InterruptCommand: # Do nothing, clean exit @@ -762,7 +762,7 @@ def cmdhandler( ret = yield _run_command( cmd, cmdname, args, raw_cmdname, cmdset, session, account, cmdset_providers ) - returnValue(ret) + return ret except ErrorReported as exc: # this error was already reported, so we @@ -786,7 +786,7 @@ def cmdhandler( account, cmdset_providers, ) - returnValue(ret) + return ret elif sysarg: # return system arg error_to.msg(err_helper(exc.sysarg, cmdid=cmdid))