From 2f7aa773c6cb8183b2b7b84d046f9e7c241ca8df Mon Sep 17 00:00:00 2001 From: Sebb Date: Wed, 21 Jan 2026 15:02:41 +0000 Subject: [PATCH] Don't redefine variable in containing scope This fixes #46 --- src/asfquart/auth.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/asfquart/auth.py b/src/asfquart/auth.py index 7380cfb..1318258 100644 --- a/src/asfquart/auth.py +++ b/src/asfquart/auth.py @@ -109,7 +109,7 @@ def require( # Require either ASF member OR project chair, but also require MFA enabled in any case. """ - async def require_wrapper(func: typing.Callable, all_of=None, any_of=None, *args, **kwargs): + async def require_wrapper(original_func: typing.Callable, all_of=None, any_of=None, *args, **kwargs): client_session = await session.read() errors_list = [] # First off, test if we have a session at all. @@ -140,8 +140,8 @@ async def require_wrapper(func: typing.Callable, all_of=None, any_of=None, *args if errors_list: raise AuthenticationFailed("\n".join(errors_list)) if args or kwargs: - return await func(*args, **kwargs) - return await func() + return await original_func(*args, **kwargs) + return await original_func() # If decorator is passed without arguments, func will be an async function # In this case, we will return a simple wrapper.