diff options
author | Erlend E. Aasland <erlend.aasland@protonmail.com> | 2023-01-31 20:42:03 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-31 20:42:03 (GMT) |
commit | 2753cf2ed6eb329bdc34b8f67228801182b82160 (patch) | |
tree | b1fa68edc115a6bf451d44e49319a7ba0452de5a /Objects/clinic/codeobject.c.h | |
parent | 0062f538d937de55cf3b66b4a8d527b1fe9d5182 (diff) | |
download | cpython-2753cf2ed6eb329bdc34b8f67228801182b82160.zip cpython-2753cf2ed6eb329bdc34b8f67228801182b82160.tar.gz cpython-2753cf2ed6eb329bdc34b8f67228801182b82160.tar.bz2 |
gh-101409: Improve generated clinic code for self type checks (#101411)
Diffstat (limited to 'Objects/clinic/codeobject.c.h')
-rw-r--r-- | Objects/clinic/codeobject.c.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/clinic/codeobject.c.h b/Objects/clinic/codeobject.c.h index da33f4a..5ad4b1f 100644 --- a/Objects/clinic/codeobject.c.h +++ b/Objects/clinic/codeobject.c.h @@ -30,6 +30,7 @@ static PyObject * code_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; + PyTypeObject *base_tp = &PyCode_Type; int argcount; int posonlyargcount; int kwonlyargcount; @@ -49,8 +50,7 @@ code_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) PyObject *freevars = NULL; PyObject *cellvars = NULL; - if ((type == &PyCode_Type || - type->tp_init == PyCode_Type.tp_init) && + if ((type == base_tp || type->tp_init == base_tp->tp_init) && !_PyArg_NoKeywords("code", kwargs)) { goto exit; } @@ -488,4 +488,4 @@ code__varname_from_oparg(PyCodeObject *self, PyObject *const *args, Py_ssize_t n exit: return return_value; } -/*[clinic end generated code: output=b6c98f17c60ace53 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f1fab6e71c785182 input=a9049054013a1b77]*/ |