Skip to content

Commit 328c75d

Browse files
committed
Support _StrPromise
1 parent 5eff75c commit 328c75d

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
@@ -1,6 +1,7 @@
11
from typing import Any, Dict, List, Optional, Sequence, Union
22

33
from django.http import HttpRequest, JsonResponse
4+
from django.utils.functional import _StrPromise
45
from rest_framework.renderers import BaseRenderer
56
from rest_framework.request import Request
67

@@ -12,7 +13,7 @@ class ErrorDetail(str):
1213
code: Optional[str] = None
1314
def __new__(cls, string: str, code: Optional[str] = ...): ...
1415

15-
_Detail = Union[str, List[Any], Dict[str, Any]]
16+
_Detail = Union[str, _StrPromise, List[Any], Dict[str, Any]]
1617

1718
class APIException(Exception):
1819
status_code: int = ...

0 commit comments

Comments
 (0)