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
Next Next commit
Address review
  • Loading branch information
sobolevn committed Oct 31, 2023
commit 42e2887514d26d150a722f0a4c126764c4dd63f9
9 changes: 3 additions & 6 deletions Lib/doctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1399,15 +1399,12 @@ def __run(self, test, compileflags, out):
# we don't care about the carets / suggestions / etc
# We only care about the error message and notes.
# They start with `SyntaxError:` (or any other class name)
exc_name = f"{exception[0].__qualname__}:"
exc_fullname = f"{exception[0].__module__}.{exception[0].__qualname__}:"
Comment thread
sobolevn marked this conversation as resolved.
Outdated
exc_msg_index = next(
index
for index, line in enumerate(formatted_ex)
if (
line.startswith(f"{exception[0].__qualname__}:")
or line.startswith(
f"{exception[0].__module__}.{exception[0].__qualname__}:",
)
)
if line.startswith(exc_name) or line.startswith(exc_fullname)
Comment thread
sobolevn marked this conversation as resolved.
Outdated
)
formatted_ex = formatted_ex[exc_msg_index:]

Expand Down