mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 11:10:14 +01:00
py/objexcept: Remove optional TimeoutError exception.
TimeoutError was added back in077812b2abfor the cc3200 port. Inf522849a4dthe cc3200 port enabled use of it in the socket module aliased to socket.timeout. So it was never added to the builtins. Then it was replaced by OSError(ETIMEDOUT) in047af9b10b. The esp32 port enables this exception, since the very beginning of that port, but it could never be accessed because it's not in builtins. It's being removed: 1) to not encourage its use; 2) because there are a lot of other OSError subclasses which are not defined at all, and having TimeoutError is a bit inconsistent. Note that ports can add anything to the builtins via MICROPY_PORT_BUILTINS. And they can also define their own exceptions using the MP_DEFINE_EXCEPTION() macro.
This commit is contained in:
1
py/obj.h
1
py/obj.h
@@ -650,7 +650,6 @@ extern const mp_obj_type_t mp_type_MemoryError;
|
||||
extern const mp_obj_type_t mp_type_NameError;
|
||||
extern const mp_obj_type_t mp_type_NotImplementedError;
|
||||
extern const mp_obj_type_t mp_type_OSError;
|
||||
extern const mp_obj_type_t mp_type_TimeoutError;
|
||||
extern const mp_obj_type_t mp_type_OverflowError;
|
||||
extern const mp_obj_type_t mp_type_RuntimeError;
|
||||
extern const mp_obj_type_t mp_type_StopAsyncIteration;
|
||||
|
||||
Reference in New Issue
Block a user