py3: use format_exc instead of print_exception

This commit is contained in:
Mr. Outis
2020-01-06 23:40:00 -06:00
parent 11fa9204f8
commit 7ed4fd3840
+2 -8
View File
@@ -1,6 +1,6 @@
"""Manages logging configuration for dvc repo."""
import io
import traceback
import logging.config
import logging.handlers
@@ -101,14 +101,8 @@ class ColorFormatter(logging.Formatter):
return description.format(message=message, exception=exception)
def _walk_exc(self, exc_info):
import traceback
buffer = io.StringIO()
traceback.print_exception(*exc_info, file=buffer)
exc = exc_info[1]
tb = buffer.getvalue()
tb = traceback.format_exc(*exc_info)
exc_list = [str(exc)]
tb_list = [tb]