mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-98254: Include stdlib module names in error messages for NameErrors (#98255)
This commit is contained in:
parent
3a639bbeac
commit
bb56dead33
6 changed files with 101 additions and 31 deletions
|
@ -39,7 +39,8 @@ class ExceptionTest(unittest.TestCase):
|
|||
|
||||
data = (('1/0', ZeroDivisionError, "division by zero\n"),
|
||||
('abc', NameError, "name 'abc' is not defined. "
|
||||
"Did you mean: 'abs'?\n"),
|
||||
"Did you mean: 'abs'? "
|
||||
"Or did you forget to import 'abc'?\n"),
|
||||
('int.reel', AttributeError,
|
||||
"type object 'int' has no attribute 'reel'. "
|
||||
"Did you mean: 'real'?\n"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue