Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions 4 Lib/multiprocessing/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ def MakeProxyType(name, exposed, _cache={}):


def AutoProxy(token, serializer, manager=None, authkey=None,
exposed=None, incref=True):
exposed=None, incref=True, manager_owned=False):
'''
Return an auto-proxy for `token`
'''
Expand All @@ -978,7 +978,7 @@ def AutoProxy(token, serializer, manager=None, authkey=None,

ProxyType = MakeProxyType('AutoProxy[%s]' % token.typeid, exposed)
proxy = ProxyType(token, serializer, manager=manager, authkey=authkey,
incref=incref)
incref=incref, manager_owned=manager_owned)
proxy._isauto = True
return proxy

Expand Down
10 changes: 10 additions & 0 deletions 10 Lib/test/_test_multiprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2256,6 +2256,16 @@ def test_dict_proxy_nested(self):
self.assertIsInstance(outer[0], list) # Not a ListProxy
self.assertEqual(outer[-1][-1]['feed'], 3)

def test_nested_queue(self):
a = self.list() # Test queue inside list
a.append(self.Queue())
a[0].put(123)
self.assertEqual(a[0].get(), 123)
b = self.dict() # Test queue inside dict
b[0] = self.Queue()
b[0].put(456)
self.assertEqual(b[0].get(), 456)

def test_namespace(self):
n = self.Namespace()
n.name = 'Bob'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Pass multiprocessing BaseProxy argument `manager_owned` through AutoProxy
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add test for nested queues when using ``multiprocessing`` shared objects
``AutoProxy[Queue]`` inside ``ListProxy`` and ``DictProxy``
Morty Proxy This is a proxified and sanitized view of the page, visit original site.