Skip to content

Commit 390020e

Browse files
committed
atom.base: minor Cpv __reduce__() simplification
1 parent a0f3d64 commit 390020e

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/pkgcraft/atom/base.pyx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,7 @@ cdef class Cpv:
180180

181181
def __reduce__(self):
182182
"""Support pickling Cpv objects."""
183-
c_str = C.pkgcraft_atom_str(self.ptr)
184-
s = c_str.decode()
185-
C.pkgcraft_str_free(c_str)
186-
return (self.__class__, (s,))
183+
return (self.__class__, (str(self),))
187184

188185
# TODO: move to __del__() when migrating to >=cython-3 since it's not
189186
# supported in <cython-3 for cdef classes:

0 commit comments

Comments
 (0)