| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 103ae4e commit 00fe618
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -60,9 +60,14 @@ Printing and clearing | |||
| 60 | 60 | Call this function **only** when the error indicator is set. Otherwise it | |
| 61 | 61 | will cause a fatal error! | |
| 62 | 62 | ||
| 63 | - If *set_sys_last_vars* is nonzero, the variables :data:`sys.last_type`, | ||
| 64 | - :data:`sys.last_value` and :data:`sys.last_traceback` will be set to the | ||
| 65 | - type, value and traceback of the printed exception, respectively. | ||
| 63 | + If *set_sys_last_vars* is nonzero, the variable :data:`sys.last_exc` is | ||
| 64 | + set to the printed exception. For backwards compatibility, the | ||
| 65 | + deprecated variables :data:`sys.last_type`, :data:`sys.last_value` and | ||
| 66 | + :data:`sys.last_traceback` are also set to the type, value and traceback | ||
| 67 | + of this exception, respectively. | ||
| 68 | + | ||
| 69 | + .. versionchanged:: 3.12 | ||
| 70 | + The setting of :data:`sys.last_exc` was added. | ||
| 66 | 71 | ||
| 67 | 72 | ||
| 68 | 73 | .. c:function:: void PyErr_Print() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -86,10 +86,9 @@ The module defines the following functions: | |||
| 86 | 86 | ||
| 87 | 87 | .. function:: print_last(limit=None, file=None, chain=True) | |
| 88 | 88 | ||
| 89 | - This is a shorthand for ``print_exception(sys.last_type, sys.last_value, | ||
| 90 | - sys.last_traceback, limit, file, chain)``. In general it will work only | ||
| 91 | - after an exception has reached an interactive prompt (see | ||
| 92 | - :data:`sys.last_type`). | ||
| 89 | + This is a shorthand for ``print_exception(sys.last_exc, limit, file, | ||
| 90 | + chain)``. In general it will work only after an exception has reached | ||
| 91 | + an interactive prompt (see :data:`sys.last_exc`). | ||
| 93 | 92 | ||
| 94 | 93 | ||
| 95 | 94 | .. function:: print_stack(f=None, limit=None, file=None) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments