8000 gh-98254: Include stdlib module names in error messages for NameErrors by pablogsal · Pull Request #98255 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-98254: Include stdlib module names in error messages for NameErrors #98255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Oct 15, 2022
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
Add more tests
  • Loading branch information
pablogsal committed Oct 13, 2022
commit 46ce50f419c7ac47fcbca8c98ede8ba759e98164
8 changes: 8 additions & 0 deletions Lib/test/test_traceback.py
Original file line number Diff line number Diff line change
Expand Up @@ -3192,6 +3192,14 @@ def func():
actual = self.get_suggestion(func)
self.assertIn("forget to import 'io'", actual)

def test_name_error_for_private_stdlib_modules(self):
def func():
stream = _io.StringIO()

actual = self.get_suggestion(func)
self.assertIn("forget to import '_io'", actual)



class PurePythonSuggestionFormattingTests(
PurePythonExceptionFormattingMixin,
Expand Down
0