Skip to content

Commit a0323b9

Browse files
committed
Support _StrPromise
1 parent d442d98 commit a0323b9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rest_framework-stubs/exceptions.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ from typing import Any
44
from typing_extensions import TypeAlias
55

66
from django.http import HttpRequest, JsonResponse
7+
from django.utils.functional import _StrPromise
78
from rest_framework.renderers import BaseRenderer
89
from rest_framework.request import Request
910

@@ -15,7 +16,7 @@ class ErrorDetail(str):
1516
code: str | None
1617
def __new__(cls, string: str, code: str | None = ...): ...
1718

18-
_Detail: TypeAlias = str | list[Any] | dict[str, Any]
19+
_Detail: TypeAlias = str | _StrPromise | list[Any] | dict[str, Any]
1920

2021
class APIException(Exception):
2122
status_code: int

0 commit comments

Comments
 (0)