commit | c06a6d0958e2eb4449605069b9c10d656ab756e8 | [log] [tgz] |
---|---|---|
author | Serhiy Storchaka <storchaka@gmail.com> | Sat Dec 19 20:07:48 2015 +0200 |
committer | Serhiy Storchaka <storchaka@gmail.com> | Sat Dec 19 20:07:48 2015 +0200 |
tree | 3be097cf344ed6c277ca77bd37f253f5c66d3a7d | |
parent | 6f3d5da36cb6f7a7472c69f92de16682e5a82620 [diff] [blame] |
Issue #25421: __sizeof__ methods of builtin types now use dynamic basic size. This allows sys.getsize() to work correctly with their subclasses with __slots__ defined.
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index 8fdf7f7..1ebccdf 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c
@@ -655,7 +655,7 @@ { Py_ssize_t res; - res = sizeof(mmap_object); + res = _PyObject_SIZE(Py_TYPE(self)); if (self->tagname) res += strlen(self->tagname) + 1; return PyLong_FromSsize_t(res);