[issue22986] Improved handling of __class__ assignment

Nathaniel Smith report at bugs.python.org
Wed Dec 3 01:04:19 CET 2014


Nathaniel Smith added the comment:

Here's a slightly improved patch spurred by a parenthetical comment of Antoine's on the mailing list :-).

The only change is that it adds a check in subclass_dealloc to correct the reference counting in the weird case that someone converts a HEAPTYPE object into a non-HEAPTYPE object while it is being deallocated.

I should probably also mention that I ran the full test suite against the patched version and everything passed; and with -R 3:2 the only difference is a new reference leak in test_zipfile. I'm guessing this might be spurious, given that AFAIK this test shouldn't be touching __class__ assignment at all? But IDK.

----------
Added file: http://bugs.python.org/file37347/better-__class__-assignment-v2.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22986>
_______________________________________


More information about the Python-bugs-list mailing list