summaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/Modules/symtablemodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/tools/python3/Modules/symtablemodule.c')
-rw-r--r--contrib/tools/python3/Modules/symtablemodule.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/contrib/tools/python3/Modules/symtablemodule.c b/contrib/tools/python3/Modules/symtablemodule.c
index 1f09c23bb85..562be6d3eb6 100644
--- a/contrib/tools/python3/Modules/symtablemodule.c
+++ b/contrib/tools/python3/Modules/symtablemodule.c
@@ -1,4 +1,5 @@
#include "Python.h"
+#include "pycore_pythonrun.h" // _Py_SourceAsString()
#include "pycore_symtable.h" // struct symtable
#include "clinic/symtablemodule.c.h"
@@ -12,7 +13,7 @@ module _symtable
_symtable.symtable
source: object
- filename: object(converter='PyUnicode_FSDecoder')
+ filename: unicode_fs_decoded
startstr: str
/
@@ -22,7 +23,7 @@ Return symbol and scope dictionaries used internally by compiler.
static PyObject *
_symtable_symtable_impl(PyObject *module, PyObject *source,
PyObject *filename, const char *startstr)
-/*[clinic end generated code: output=59eb0d5fc7285ac4 input=9dd8a50c0c36a4d7]*/
+/*[clinic end generated code: output=59eb0d5fc7285ac4 input=436ffff90d02e4f6]*/
{
struct symtable *st;
PyObject *t;
@@ -46,12 +47,10 @@ _symtable_symtable_impl(PyObject *module, PyObject *source,
else {
PyErr_SetString(PyExc_ValueError,
"symtable() arg 3 must be 'exec' or 'eval' or 'single'");
- Py_DECREF(filename);
Py_XDECREF(source_copy);
return NULL;
}
st = _Py_SymtableStringObjectFlags(str, filename, start, &cf);
- Py_DECREF(filename);
Py_XDECREF(source_copy);
if (st == NULL) {
return NULL;
@@ -87,11 +86,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;
@@ -109,6 +108,7 @@ symtable_init_constants(PyObject *m)
static PyModuleDef_Slot symtable_slots[] = {
{Py_mod_exec, symtable_init_constants},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {Py_mod_gil, Py_MOD_GIL_NOT_USED},
{0, NULL}
};