Code source de teachpyx.faq.faq_exception
# -*- coding: utf-8 -*-
"""
Quelques questions d'ordre général autour du langage Python.
:githublink:`%|py|7`
"""
import sys
import traceback
[docs]def call_stack():
"""
:return: traceback
:githublink:`%|py|14`
"""
exc_traceback = sys.exc_info()[-1]
return traceback.extract_tb(exc_traceback), "".join(traceback.format_tb(exc_traceback))