bpo-25750: fix refcounts in type_getattro() (GH-6118)

When calling tp_descr_get(self, obj, type), make sure that
we own a strong reference to "self".
(cherry picked from commit 8f735485ac)

Co-authored-by: jdemeyer <jdemeyer@cage.ugent.be>
This commit is contained in:
Miss Islington (bot) 2018-09-07 00:50:35 -07:00 committed by GitHub
parent 2d3f2dc9f8
commit f862f3abae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 6 deletions

View file

@ -0,0 +1,2 @@
Fix rare Python crash due to bad refcounting in ``type_getattro()`` if a
descriptor deletes itself from the class. Patch by Jeroen Demeyer.