mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 00:14:41 +01:00
Rewrited deprecated in print_exception
(#5407)
* Change deprecated sys variable assignment in print_exception * Add changelog in news/print_exception_fix.rst
This commit is contained in:
parent
b1ffb11f27
commit
4e06328bec
2 changed files with 25 additions and 2 deletions
23
news/print_exception_fix.rst
Normal file
23
news/print_exception_fix.rst
Normal file
|
@ -0,0 +1,23 @@
|
|||
**Added:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Changed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Deprecated:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Removed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Fixed:**
|
||||
|
||||
* Replaced deprecated `sys.last_type, sys.last_value, sys.last_traceback` with `sys.last_exc`
|
||||
|
||||
**Security:**
|
||||
|
||||
* <news item>
|
|
@ -1025,7 +1025,7 @@ def print_warning(msg):
|
|||
|
||||
|
||||
def print_exception(msg=None, exc_info=None, source_msg=None):
|
||||
"""Print given exception (or current if None) with/without traceback and set sys.last_type, sys.last_value, sys.last_traceback accordingly."""
|
||||
"""Print given exception (or current if None) with/without traceback and set sys.last_exc accordingly."""
|
||||
|
||||
# is no exec_info() triple is given, use the exception beeing handled at the moment
|
||||
if exc_info is None:
|
||||
|
@ -1055,7 +1055,7 @@ def print_exception(msg=None, exc_info=None, source_msg=None):
|
|||
limit = 0
|
||||
chain = False
|
||||
|
||||
sys.last_type, sys.last_value, sys.last_traceback = exc_info
|
||||
sys.last_exc = exc_info
|
||||
|
||||
manually_set_trace, show_trace = _get_manual_env_var("XONSH_SHOW_TRACEBACK", False)
|
||||
manually_set_logfile, log_file = _get_manual_env_var("XONSH_TRACEBACK_LOGFILE")
|
||||
|
|
Loading…
Add table
Reference in a new issue