diff options
Diffstat (limited to 'Doc/library/traceback.rst')
-rw-r--r-- | Doc/library/traceback.rst | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Doc/library/traceback.rst b/Doc/library/traceback.rst index 32e5733..b68a8f1 100644 --- a/Doc/library/traceback.rst +++ b/Doc/library/traceback.rst @@ -129,6 +129,13 @@ The module defines the following functions: A shorthand for ``format_list(extract_stack(f, limit))``. +.. function:: clear_frames(tb) + + Clears the local variables of all the stack frames in a traceback *tb* + by calling the :meth:`clear` method of each frame object. + + .. versionadded:: 3.4 + .. _traceback-example: @@ -146,7 +153,7 @@ module. :: source = input(">>> ") try: exec(source, envdir) - except: + except Exception: print("Exception in user code:") print("-"*60) traceback.print_exc(file=sys.stdout) |