Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
zpz committed Jun 2, 2024
1 parent 43d00dc commit c300982
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).


## [0.15.6] - in progress
## [0.15.6] - 2024-06-02

- Finetune `mpservice.multiprocessing.server_process`:
- support pickling of `ServerProcess` objects.
Expand Down
2 changes: 1 addition & 1 deletion src/mpservice/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
python3 -m pip install mpservice
"""

__version__ = '0.15.5'
__version__ = '0.15.6'


from . import (
Expand Down
8 changes: 6 additions & 2 deletions src/mpservice/multiprocessing/server_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,9 +483,13 @@ def start(self, *args, **kwargs):
return z

def __reduce__(self):
if get_spawning_popen() is not None:
auth = self._authkey
else:
auth = None
return (
self._rebuild_manager,
(self.__class__, self._address, self._authkey, self._serializer),
(type(self), self._address, auth, self._serializer),
)

@staticmethod
Expand Down Expand Up @@ -699,7 +703,7 @@ def __reduce__(self):
kwds = {}
if get_spawning_popen() is not None:
kwds['authkey'] = self._authkey
elif get_server(self._token.address):
elif self._server:
kwds = {'authkey': bytes(self._authkey)}
# Bypass a security check of `multiprocessing.process.AuthenticationString`,
# because returning a proxy from the server is safe.
Expand Down

0 comments on commit c300982

Please sign in to comment.