Skip to content

Commit

Permalink
Remove trio.format_exception
Browse files Browse the repository at this point in the history
Deprecated in 0.2.0 (see python-triogh-347)
  • Loading branch information
njsmith committed Dec 25, 2017
1 parent 5f4825d commit a246437
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 31 deletions.
19 changes: 1 addition & 18 deletions trio/_core/_multierror.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@

import attr

from .._deprecate import deprecated

__all__ = ["MultiError", "format_exception"]
__all__ = ["MultiError"]

################################################################
# MultiError
Expand Down Expand Up @@ -349,21 +347,6 @@ def concat_tb(head, tail):
# MultiErrors
################################################################


@deprecated("0.2.0", issue=347, instead="traceback.format_exception")
def format_exception(etype, value, tb, *, limit=None, chain=True):
"""Like :func:`traceback.format_exception`, but with special support for
printing :exc:`MultiError` objects.
This is a pure, stateless function, and thus safe to call from any
thread at any time.
"""
return traceback.format_exception(
etype, value, tb, limit=limit, chain=chain
)


traceback_exception_original_init = traceback.TracebackException.__init__


Expand Down
13 changes: 1 addition & 12 deletions trio/_core/tests/test_multierror.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
from .tutil import slow

from ..._deprecate import TrioDeprecationWarning
from .._multierror import (
MultiError, concat_tb, format_exception as trio_format_exception
)
from .._multierror import MultiError, concat_tb


def raiser1():
Expand Down Expand Up @@ -487,15 +485,6 @@ def raise2_raiser1():
formatted
)

# Deprecation

with pytest.warns(TrioDeprecationWarning) as record:
exc_info = einfo(make_tree())
assert format_exception(*exc_info) == trio_format_exception(*exc_info)

assert 'trio.format_exception is deprecated since Trio 0.2.0; ' \
'use traceback.format_exception instead' in record[0].message.args[0]


def test_logging(caplog):
exc1 = get_exc(raiser1)
Expand Down
1 change: 0 additions & 1 deletion trio/_toplevel_core_reexports.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"ResourceBusyError",
"MultiError",
"run",
"format_exception",
"open_nursery",
"open_cancel_scope",
"current_effective_deadline",
Expand Down

0 comments on commit a246437

Please sign in to comment.