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

make AsStream public

parent 0e95e386
No related branches found
No related tags found
No related merge requests found
from .dump_to_file import *
from .exception_handlers import *
from .global_eh import *
__all__ = [
'GlobalExcepthook',
'BaseExceptionHandler', 'exception_handler', 'FunctionExceptionHandler',
'NORMAL_PRIORITY', 'ALWAYS_LAST', 'ALWAYS_FIRST',
'DumpToFileHandler'
'DumpToFileHandler', 'AsStream'
]
from .dump_to_file import *
from .exception_handlers import *
from .global_eh import *
......@@ -13,7 +13,7 @@ from .exception_handlers import BaseExceptionHandler
logger = logging.getLogger(__name__)
__all__ = [
'DumpToFileHandler'
'DumpToFileHandler', 'AsStream'
]
AsStreamTypeAccept = tb.Union[str, tb.IO, None]
......@@ -84,8 +84,8 @@ class DumpToFileHandler(BaseExceptionHandler):
:param trace_pickles: iterable of either a file-like objects, or paths where pickles with stack status will be output
"""
super(DumpToFileHandler, self).__init__()
self.hr = [AsStream(x, True) for x in human_readables]
self.tp = [AsStream(x, False) for x in trace_pickles]
self.hr = [AsStream(x, True) if not isinstance(x, AsStream) else x for x in human_readables]
self.tp = [AsStream(x, False) if not isinstance(x, AsStream) else x for x in trace_pickles]
def handle_exception(self, type_, value, traceback):
try:
......
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