mirror of
https://github.com/python/cpython.git
synced 2025-12-11 11:31:05 +00:00
While a speedup of 1% is measurable, contexts aren't created that often,
so let's defer this until 3.7, 3.8, ... all have this new function.
This commit is contained in:
parent
a40a3f35eb
commit
3c29fd0074
1 changed files with 4 additions and 4 deletions
|
|
@ -1194,13 +1194,13 @@ context_new(PyTypeObject *type, PyObject *args UNUSED, PyObject *kwds UNUSED)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
self->traps = _PyObject_CallNoArg((PyObject *)PyDecSignalDict_Type);
|
self->traps = PyObject_CallObject((PyObject *)PyDecSignalDict_Type, NULL);
|
||||||
if (self->traps == NULL) {
|
if (self->traps == NULL) {
|
||||||
self->flags = NULL;
|
self->flags = NULL;
|
||||||
Py_DECREF(self);
|
Py_DECREF(self);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
self->flags = _PyObject_CallNoArg((PyObject *)PyDecSignalDict_Type);
|
self->flags = PyObject_CallObject((PyObject *)PyDecSignalDict_Type, NULL);
|
||||||
if (self->flags == NULL) {
|
if (self->flags == NULL) {
|
||||||
Py_DECREF(self);
|
Py_DECREF(self);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
@ -1395,7 +1395,7 @@ ieee_context(PyObject *dummy UNUSED, PyObject *v)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
context = _PyObject_CallNoArg((PyObject *)&PyDecContext_Type);
|
context = PyObject_CallObject((PyObject *)&PyDecContext_Type, NULL);
|
||||||
if (context == NULL) {
|
if (context == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
@ -1417,7 +1417,7 @@ context_copy(PyObject *self, PyObject *args UNUSED)
|
||||||
{
|
{
|
||||||
PyObject *copy;
|
PyObject *copy;
|
||||||
|
|
||||||
copy = _PyObject_CallNoArg((PyObject *)&PyDecContext_Type);
|
copy = PyObject_CallObject((PyObject *)&PyDecContext_Type, NULL);
|
||||||
if (copy == NULL) {
|
if (copy == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue