Skip to content

Commit

Permalink
Do not touch coroutines
Browse files Browse the repository at this point in the history
  • Loading branch information
krassowski committed Feb 11, 2024
1 parent faee488 commit 204d29f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions jupyter_server/auth/decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,8 @@ def allow_unauthenticated(method: FuncT) -> FuncT:
"""

@wraps(method)
async def wrapper(self, *args, **kwargs):
out = method(self, *args, **kwargs)
# If the method is a coroutine, await it
if asyncio.iscoroutine(out):
return await out
return out
def wrapper(self, *args, **kwargs):
return method(self, *args, **kwargs)

setattr(wrapper, "__allow_unauthenticated", True)

Expand Down

0 comments on commit 204d29f

Please sign in to comment.