Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
depth --> _depth
  • Loading branch information
iritkatriel committed Jun 5, 2023
commit 91366ac0abd184818e937b68abd4957cbd3e102f
6 changes: 3 additions & 3 deletions Lib/traceback.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ def __eq__(self, other):
def __str__(self):
return self._str

def format_exception_only(self, *, show_group=False, depth=0):
def format_exception_only(self, *, show_group=False, _depth=0):
"""Format the exception part of the traceback.

The return value is a generator of strings, each ending in a newline.
Expand All @@ -840,7 +840,7 @@ def format_exception_only(self, *, show_group=False, depth=0):
string in the output.
"""

indent = 3 * depth * ' '
indent = 3 * _depth * ' '
if self.exc_type is None:
yield indent + _format_final_exc_line(None, self._str)
return
Expand Down Expand Up @@ -869,7 +869,7 @@ def format_exception_only(self, *, show_group=False, depth=0):

if self.exceptions and show_group:
for ex in self.exceptions:
yield from ex.format_exception_only(show_group=show_group, depth=depth+1)
yield from ex.format_exception_only(show_group=show_group, _depth=_depth+1)

def _format_syntax_error(self, stype):
"""Format SyntaxError exceptions (internal helper)."""
Expand Down