main: clean the terminal line before printing a traceback

Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent e75be7e7
...@@ -33,7 +33,7 @@ from .path import set_path ...@@ -33,7 +33,7 @@ from .path import set_path
from .tools import tool_prepend_prefix, tool_required, OS_NAMES, get_current_os from .tools import tool_prepend_prefix, tool_required, OS_NAMES, get_current_os
from .config import Config from .config import Config
from .locale import set_locale from .locale import set_locale
from .logging import setup_logging from .logging import line_ereser, setup_logging
from .progress import ProgressManager, Progress from .progress import ProgressManager, Progress
from .profiling import ProfileManager, profile from .profiling import ProfileManager, profile
from .tempfiles import clean_all_temp_files from .tempfiles import clean_all_temp_files
...@@ -464,6 +464,7 @@ def main(args=None): ...@@ -464,6 +464,7 @@ def main(args=None):
except BrokenPipeError: except BrokenPipeError:
sys.exit(2) sys.exit(2)
except Exception: except Exception:
sys.stderr.buffer.write(line_ereser())
traceback.print_exc() traceback.print_exc()
if parsed_args and parsed_args.debugger: if parsed_args and parsed_args.debugger:
import pdb import pdb
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment