returnValue() deprecated

This commit is contained in:
0xDEADFED5 2025-02-07 14:35:11 -08:00
parent e76169681e
commit 96ddf39b5b

View file

@ -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))