mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
gh-119933: Improve `SyntaxError
` message for invalid type parameters expressions (#119976)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
parent
274f844830
commit
4bf17c381f
9 changed files with 277 additions and 55 deletions
|
@ -91,11 +91,11 @@ symtable_init_constants(PyObject *m)
|
|||
return -1;
|
||||
if (PyModule_AddIntConstant(m, "TYPE_ANNOTATION", AnnotationBlock) < 0)
|
||||
return -1;
|
||||
if (PyModule_AddIntConstant(m, "TYPE_TYPE_VAR_BOUND", TypeVarBoundBlock) < 0)
|
||||
return -1;
|
||||
if (PyModule_AddIntConstant(m, "TYPE_TYPE_ALIAS", TypeAliasBlock) < 0)
|
||||
return -1;
|
||||
if (PyModule_AddIntConstant(m, "TYPE_TYPE_PARAM", TypeParamBlock) < 0)
|
||||
if (PyModule_AddIntConstant(m, "TYPE_TYPE_PARAMETERS", TypeParametersBlock) < 0)
|
||||
return -1;
|
||||
if (PyModule_AddIntConstant(m, "TYPE_TYPE_VARIABLE", TypeVariableBlock) < 0)
|
||||
return -1;
|
||||
|
||||
if (PyModule_AddIntMacro(m, LOCAL) < 0) return -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue