Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 7 additions & 1 deletion Lib/test/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1840,7 +1840,13 @@ def f():
with support.captured_stderr() as err:
sys.__excepthook__(*sys.exc_info())

self.assertNotIn("a1", err.getvalue())
traceback = err.getvalue()

# remvoe the source path from the traceback, it could contain "a1" in it
# https://bugs.python.org/issue45400
traceback = traceback.replace(__file__, os.path.basename(__file__))

self.assertNotIn("a1", traceback)

def test_name_error_with_custom_exceptions(self):
def f():
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
The ``test_name_error_suggestions_do_not_trigger_for_too_many_locals`` will
no longer fail when run from a directory that contains ``a1`` in the path,
which is likely to happen when building from unpacked sources of a first
alpha release.