Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions indexed_gzip/indexed_gzip.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,11 @@ class IndexedGzipFile(io.BufferedReader):
return self.read(nbytes)


def __reduce__(self):
def __reduce_ex__(self, protocol):
"""Used to pickle an ``IndexedGzipFile``.

:arg protocol: Pickle protocol version

Returns a tuple containing:
- a reference to the ``unpickle`` function
- a tuple containing a "state" object, which can be passed
Expand Down Expand Up @@ -1093,7 +1095,7 @@ def unpickle(state):
"""Create a new ``IndexedGzipFile`` from a pickled state.

:arg state: State of a pickled object, as returned by the
``IndexedGzipFile.__reduce__`` method.
``IndexedGzipFile.__reduce_ex__`` method.

:returns: A new ``IndexedGzipFile`` object.
"""
Expand Down