(original) (raw)

changeset: 99976:e7062dd9085e branch: 2.7 parent: 99962:04e95f05aafe user: Benjamin Peterson benjamin@python.org date: Mon Jan 18 21:17:54 2016 -0800 files: Objects/typeobject.c description: set tp_new from the class in the hierarchy that actually owns the descriptor (closes #25731) Debugging by Eryk Sun. diff -r 04e95f05aafe -r e7062dd9085e Objects/typeobject.c --- a/Objects/typeobject.c Mon Jan 18 19:38:53 2016 +0200 +++ b/Objects/typeobject.c Mon Jan 18 21:17:54 2016 -0800 @@ -6239,7 +6239,7 @@ sanity checks and constructing a new argument list. Cut all that nonsense short -- this speeds up instance creation tremendously. */ - specific = (void *)type->tp_new; + specific = (void *)((PyTypeObject *)PyCFunction_GET_SELF(descr))->tp_new; /* XXX I'm not 100% sure that there isn't a hole in this reasoning that requires additional sanity checks. I'll buy the first person to /benjamin@python.org