assume that _run_command doesn't return Deferred

This commit is contained in:
0xDEADFED5 2025-02-08 20:34:13 -08:00
parent 9136f92c75
commit 24aed0098d

View file

@ -646,9 +646,6 @@ def cmdhandler(
else: else:
caller.ndb.last_cmd = None caller.ndb.last_cmd = None
# return result to the deferred
return ret
except InterruptCommand: except InterruptCommand:
# Do nothing, clean exit # Do nothing, clean exit
pass pass
@ -757,10 +754,9 @@ def cmdhandler(
cmd = copy(cmd) cmd = copy(cmd)
# A normal command. # A normal command.
ret = yield _run_command( yield _run_command(
cmd, cmdname, args, raw_cmdname, cmdset, session, account, cmdset_providers cmd, cmdname, args, raw_cmdname, cmdset, session, account, cmdset_providers
) )
return ret
except ErrorReported as exc: except ErrorReported as exc:
# this error was already reported, so we # this error was already reported, so we
@ -774,7 +770,7 @@ def cmdhandler(
sysarg = exc.sysarg sysarg = exc.sysarg
if syscmd: if syscmd:
ret = yield _run_command( yield _run_command(
syscmd, syscmd,
syscmd.key, syscmd.key,
sysarg, sysarg,
@ -784,7 +780,7 @@ def cmdhandler(
account, account,
cmdset_providers, cmdset_providers,
) )
return ret return
elif sysarg: elif sysarg:
# return system arg # return system arg
error_to.msg(err_helper(exc.sysarg, cmdid=cmdid)) error_to.msg(err_helper(exc.sysarg, cmdid=cmdid))