Skip to content

Commit 6daf85e

Browse files
committed
Restructure as per review comment
1 parent ccc0060 commit 6daf85e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Lib/logging/config.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -804,8 +804,15 @@ def configure_handler(self, config):
804804
# if it's not an instance of BaseProxy, it also can't be
805805
# an instance of Manager.Queue / Manager.JoinableQueue
806806
if isinstance(qspec, BaseProxy):
807-
proxy_queue = MM().Queue()
808-
proxy_joinable_queue = MM().JoinableQueue()
807+
# Sometimes manager or queue creation might fail
808+
# (e.g. see issue gh-120868). In that case, any
809+
# exception during the creation of these queues will
810+
# propagate up to the caller and be wrapped in a
811+
# `ValueError`, whose cause will indicate the details of
812+
# the failure.
813+
mm = MM()
814+
proxy_queue = mm.Queue()
815+
proxy_joinable_queue = mm.JoinableQueue()
809816
if not isinstance(qspec, (type(proxy_queue), type(proxy_joinable_queue))):
810817
raise TypeError('Invalid queue specifier %r' % qspec)
811818
else:

0 commit comments

Comments
 (0)