-
Notifications
You must be signed in to change notification settings - Fork 468
Closed
Labels
Description
Describe the bug
API documentation suggests using stripe.error.SomeError but current modules are not importable as described.
API Doc
To Reproduce
>>> import stripe.error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'stripe.error'
>>> from stripe import error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'error' from 'stripe'
>>> import stripe.error.CardError
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'stripe.error'
>>> import stripe
>>> stripe.error.CardError
Traceback (most recent call last):
File "/.../python3.12/site-packages/stripe/__init__.py", line 872, in __getattr__
target, is_submodule = _import_map[name]
~~~~~~~~~~~^^^^^^
KeyError: 'error'
Expected behavior
>>> import stripe
>>> stripe.error.CardError
<class 'stripe._error.CardError'>
Code snippets
OS
macOS
Language version
Python 3.12
Library version
stripe-python v14.0.0
API version
2025-11-17.clover
Additional context
No response