| """Starlette status aliases that work on both old and new releases. | |
| Starlette renamed 413/422 constants. CI's newer package has the new names and | |
| deprecates the old ones; older local installs only have the old names. | |
| """ | |
| from __future__ import annotations | |
| from starlette import status as starlette_status | |
| HTTP_413_CONTENT_TOO_LARGE = getattr( | |
| starlette_status, | |
| "HTTP_413_CONTENT_TOO_LARGE", | |
| starlette_status.HTTP_413_REQUEST_ENTITY_TOO_LARGE, | |
| ) | |
| HTTP_422_UNPROCESSABLE_CONTENT = getattr( | |
| starlette_status, | |
| "HTTP_422_UNPROCESSABLE_CONTENT", | |
| starlette_status.HTTP_422_UNPROCESSABLE_ENTITY, | |
| ) | |