There was an error while loading. Please reload this page.
1 parent 5913786 commit 70fefd5Copy full SHA for 70fefd5
1 file changed
Objects/funcobject.c
@@ -7,7 +7,6 @@
7
#include "pycore_modsupport.h" // _PyArg_NoKeywords()
8
#include "pycore_object.h" // _PyObject_GC_UNTRACK()
9
#include "pycore_pyerrors.h" // _PyErr_Occurred()
10
-#include "pycore_critical_section.h" // Py_BEGIN_CRITICAL_SECTION()
11
12
13
static const char *
@@ -894,15 +893,13 @@ function___annotations___get_impl(PyFunctionObject *self)
894
893
/*[clinic end generated code: output=a4cf4c884c934cbb input=92643d7186c1ad0c]*/
895
{
896
PyObject *d = NULL;
897
- Py_BEGIN_CRITICAL_SECTION(self);
898
if (self->func_annotations == NULL &&
899
(self->func_annotate == NULL || !PyCallable_Check(self->func_annotate))) {
900
self->func_annotations = PyDict_New();
901
if (self->func_annotations == NULL)
902
return NULL;
903
}
904
d = func_get_annotation_dict(self);
905
- Py_END_CRITICAL_SECTION();
906
return Py_XNewRef(d);
907
908
@@ -926,10 +923,8 @@ function___annotations___set_impl(PyFunctionObject *self, PyObject *value)
926
923
"__annotations__ must be set to a dict object");
927
924
return -1;
928
925
929
930
Py_XSETREF(self->func_annotations, Py_XNewRef(value));
931
Py_CLEAR(self->func_annotate);
932
933
return 0;
934
935
0 commit comments