Skip to content
Snippets Groups Projects
Commit 5bd053b4 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

fix rethrow

parent b8cb0739
No related branches found
No related tags found
No related merge requests found
Pipeline #62525 passed with stages
in 1 minute and 53 seconds
# v.25.a3 # v2.25.6
* deprecated rethrow_as
* fixed circular import * fixed circular import
# v2.25.5 # v2.25.5
......
__version__ = '2.25.6a3' __version__ = '2.25.6'
...@@ -2,6 +2,7 @@ import inspect ...@@ -2,6 +2,7 @@ import inspect
import logging import logging
import threading import threading
import typing as tp import typing as tp
import warnings
from .decorators.decorators import wraps from .decorators.decorators import wraps
from .typing import ExceptionClassType, T, NoArgCallable, ExceptionList from .typing import ExceptionClassType, T, NoArgCallable, ExceptionList
...@@ -238,6 +239,7 @@ class rethrow_as: ...@@ -238,6 +239,7 @@ class rethrow_as:
exception_preprocessor: tp.Optional[tp.Callable[[Exception], str]] = repr, exception_preprocessor: tp.Optional[tp.Callable[[Exception], str]] = repr,
returns=None, returns=None,
returns_factory: tp.Optional[NoArgCallable[tp.Any]] = None): returns_factory: tp.Optional[NoArgCallable[tp.Any]] = None):
warnings.warn('Deprecated, use reraise_as', DeprecationWarning)
try: try:
a, b = pairs # throws ValueError a, b = pairs # throws ValueError
op = issubclass(b, BaseException) # throws TypeError op = issubclass(b, BaseException) # throws TypeError
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment