mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
#17032: The "global" in the "NameError: global name 'x' is not defined" error message has been removed. Patch by Ram Rachum.
This commit is contained in:
parent
ee71f4a8a4
commit
04a29554c1
4 changed files with 9 additions and 7 deletions
|
@ -182,10 +182,10 @@ class KeywordOnlyArgTestCase(unittest.TestCase):
|
|||
with self.assertRaises(NameError) as err:
|
||||
def f(v=a, x=b, *, y=c, z=d):
|
||||
pass
|
||||
self.assertEqual(str(err.exception), "global name 'b' is not defined")
|
||||
self.assertEqual(str(err.exception), "name 'b' is not defined")
|
||||
with self.assertRaises(NameError) as err:
|
||||
f = lambda v=a, x=b, *, y=c, z=d: None
|
||||
self.assertEqual(str(err.exception), "global name 'b' is not defined")
|
||||
self.assertEqual(str(err.exception), "name 'b' is not defined")
|
||||
|
||||
|
||||
def test_main():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue