Skip to content

Commit 70fefd5

Browse files
committed
remove unnecessary critical sections
1 parent 5913786 commit 70fefd5

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

Objects/funcobject.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include "pycore_modsupport.h" // _PyArg_NoKeywords()
88
#include "pycore_object.h" // _PyObject_GC_UNTRACK()
99
#include "pycore_pyerrors.h" // _PyErr_Occurred()
10-
#include "pycore_critical_section.h" // Py_BEGIN_CRITICAL_SECTION()
1110

1211

1312
static const char *
@@ -894,15 +893,13 @@ function___annotations___get_impl(PyFunctionObject *self)
894893
/*[clinic end generated code: output=a4cf4c884c934cbb input=92643d7186c1ad0c]*/
895894
{
896895
PyObject *d = NULL;
897-
Py_BEGIN_CRITICAL_SECTION(self);
898896
if (self->func_annotations == NULL &&
899897
(self->func_annotate == NULL || !PyCallable_Check(self->func_annotate))) {
900898
self->func_annotations = PyDict_New();
901899
if (self->func_annotations == NULL)
902900
return NULL;
903901
}
904902
d = func_get_annotation_dict(self);
905-
Py_END_CRITICAL_SECTION();
906903
return Py_XNewRef(d);
907904
}
908905

@@ -926,10 +923,8 @@ function___annotations___set_impl(PyFunctionObject *self, PyObject *value)
926923
"__annotations__ must be set to a dict object");
927924
return -1;
928925
}
929-
Py_BEGIN_CRITICAL_SECTION(self);
930926
Py_XSETREF(self->func_annotations, Py_XNewRef(value));
931927
Py_CLEAR(self->func_annotate);
932-
Py_END_CRITICAL_SECTION();
933928
return 0;
934929
}
935930

0 commit comments

Comments
 (0)