From 4a6881f367e7184eeddb9b812ae431838fecef4a Mon Sep 17 00:00:00 2001 From: Henrique Godoy <95002561+herniqeu@users.noreply.github.com> Date: Sat, 31 Oct 2026 22:23:37 -0300 Subject: [PATCH] fix(async client): get_default() should build the class itself AsyncApiClient.get_default does cls._default = ApiClient(), but ApiClient is not imported in the async modules (only AsyncApiClient exists there), so any call to get_default raises NameError: name 'ApiClient' is not defined. The classmethod already receives the right class, so cls() is the fix. The same generated pattern appears in the other v3 async_api_client modules; I can extend this to all of them in this PR if you prefer. Verified with pyflakes: undefined name 'ApiClient' no longer reported. Signed-off-by: Henrique Godoy <95002561+herniqeu@users.noreply.github.com> --- linebot/v3/audience/async_api_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linebot/v3/audience/async_api_client.py b/linebot/v3/audience/async_api_client.py index 5462210da..9575759bd 100644 --- a/linebot/v3/audience/async_api_client.py +++ b/linebot/v3/audience/async_api_client.py @@ -137,7 +137,7 @@ def get_default(cls): :return: The ApiClient object. """ if cls._default is None: - cls._default = ApiClient() + cls._default = cls() return cls._default @classmethod