From 5ec74e8db48e67180d4c6e2edefa0c00ad0eaa2c Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Thu, 7 Dec 2023 15:53:55 -0800 Subject: [PATCH] Fix __getattr__ to raise AttributeError rather than returning None (#1159) Signed-off-by: Anders Kaseorg Co-authored-by: Pavel Krymets --- stripe/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stripe/__init__.py b/stripe/__init__.py index f5301c707..1ce0352fb 100644 --- a/stripe/__init__.py +++ b/stripe/__init__.py @@ -177,6 +177,9 @@ def __getattr__(name): import stripe.api_resources as _api_resources return _api_resources + raise AttributeError( + f"module {__name__!r} has no attribute {name!r}" + ) else: with warnings.catch_warnings():