Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 20aa1bf

Browse files
Fix __sizeof__.
1 parent 01bc6b9 commit 20aa1bf

2 files changed

Lines changed: 1 addition & 8 deletions

File tree

Lib/test/test_pickle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ def test_pickler(self):
477477
0) # Write buffer is cleared after every dump().
478478

479479
def test_unpickler(self):
480-
basesize = support.calcobjsize('2P2n2P 2P2n2i5P 2P3n8P2n2i')
480+
basesize = support.calcobjsize('2P2n3P 2P2n2i5P 2P3n8P2n2i')
481481
unpickler = _pickle.Unpickler
482482
P = struct.calcsize('P') # Size of memo table entry.
483483
n = struct.calcsize('n') # Size of mark table entry.

Modules/_pickle.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7311,13 +7311,6 @@ _pickle_Unpickler___sizeof___impl(UnpicklerObject *self)
73117311
size_t res = _PyObject_SIZE(Py_TYPE(self));
73127312
if (self->memo != NULL)
73137313
res += self->memo_size * sizeof(PyObject *);
7314-
if (self->memo_dict != NULL) {
7315-
size_t s = _PySys_GetSizeOf(self->memo_dict);
7316-
if (s == (size_t)-1) {
7317-
return -1;
7318-
}
7319-
res += s;
7320-
}
73217314
if (self->marks != NULL)
73227315
res += (size_t)self->marks_size * sizeof(Py_ssize_t);
73237316
if (self->input_line != NULL)

0 commit comments

Comments
 (0)