mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
#2895: don't crash with bytes as keyword argument names.
This commit is contained in:
parent
bf82e374ee
commit
d8b690f7ae
3 changed files with 11 additions and 1 deletions
|
@ -265,6 +265,14 @@ class GrammarTests(unittest.TestCase):
|
|||
d22v(*(1, 2, 3, 4))
|
||||
d22v(1, 2, *(3, 4, 5))
|
||||
d22v(1, *(2, 3), **{'d': 4})
|
||||
|
||||
# keyword argument type tests
|
||||
try:
|
||||
str('x', **{b'foo':1 })
|
||||
except TypeError:
|
||||
pass
|
||||
else:
|
||||
self.fail('Bytes should not work as keyword argument names')
|
||||
# keyword only argument tests
|
||||
def pos0key1(*, key): return key
|
||||
pos0key1(key=100)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue