Skip to content

Commit

Permalink
Fix __getattr__ to raise AttributeError rather than returning None (#…
Browse files Browse the repository at this point in the history
…1159)

Signed-off-by: Anders Kaseorg <[email protected]>
Co-authored-by: Pavel Krymets <[email protected]>
  • Loading branch information
andersk and pakrym-stripe authored Dec 7, 2023
1 parent 93f4384 commit 5ec74e8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions stripe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 5ec74e8

Please sign in to comment.