stop yielding None, which is an error in Twisted 24

This commit is contained in:
0xDEADFED5 2025-02-07 22:27:30 -08:00
parent 96ddf39b5b
commit d929617b9b

View file

@ -630,14 +630,12 @@ def cmdhandler(
if isinstance(ret, types.GeneratorType):
# cmd.func() is a generator, execute progressively
_progressive_cmd_run(cmd, ret)
ret = yield ret
# note that the _progressive_cmd_run will itself run
# the at_post_cmd etc as it finishes; this is a bit of
# code duplication but there seems to be no way to
# catch the StopIteration here (it's not in the same
# frame since this is in a deferred chain)
else:
ret = yield ret
# post-command hook
yield cmd.at_post_cmd()