Skip to content

Commit a7f98fb

Browse files
committed
explicitly fix memoryview.hex
1 parent 0488d21 commit a7f98fb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Objects/memoryobject.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2349,7 +2349,10 @@ memoryview_hex_impl(PyMemoryViewObject *self, PyObject *sep,
23492349
CHECK_RELEASED(self);
23502350

23512351
if (MV_C_CONTIGUOUS(self->flags)) {
2352-
return _Py_strhex_with_sep(src->buf, src->len, sep, bytes_per_sep);
2352+
self->exports++;
2353+
PyObject *ret = _Py_strhex_with_sep(src->buf, src->len, sep, bytes_per_sep);
2354+
self->exports--;
2355+
return ret;
23532356
}
23542357

23552358
PyBytesWriter *writer = PyBytesWriter_Create(src->len);

0 commit comments

Comments
 (0)