summaryrefslogtreecommitdiffstats
path: root/Lib/doctest.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/doctest.py')
-rw-r--r--Lib/doctest.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/doctest.py b/Lib/doctest.py
index f00d935..2f14aa0 100644
--- a/Lib/doctest.py
+++ b/Lib/doctest.py
@@ -1399,10 +1399,14 @@ class DocTestRunner:
# 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)
+ exception_line_prefixes = (
+ f"{exception[0].__qualname__}:",
+ f"{exception[0].__module__}.{exception[0].__qualname__}:",
+ )
exc_msg_index = next(
index
for index, line in enumerate(formatted_ex)
- if line.startswith(f"{exception[0].__name__}:")
+ if line.startswith(exception_line_prefixes)
)
formatted_ex = formatted_ex[exc_msg_index:]