Fix a latent bug in DAP request decorator

The 'request' decorator is intended to also ensure that the request
function runs in the DAP thread.  However, the unwrapped function is
installed in the global request map, so the wrapped version is never
called.  This patch fixes the bug.
This commit is contained in:
Tom Tromey 2023-05-11 14:25:07 -06:00
parent 070e93a8b8
commit 5c7cdc95aa

View File

@ -164,9 +164,10 @@ def request(name):
def wrap(func):
global _commands
_commands[name] = func
# All requests must run in the DAP thread.
return in_dap_thread(func)
func = in_dap_thread(func)
_commands[name] = func
return func
return wrap