Guard `_mp_fixup_main` on non-empty parent data
Use walrus `:=` to combine the assignment and
truthiness check for `_parent_main_data` into the
`if` condition, cleanly skipping the fixup block
when `inherit_parent_main=False` yields `{}`.
Review: PR #438 (Copilot)
https://github.com/goodboy/tractor/pull/438
(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
subint_spawner_backend
parent
e8f1eca8d2
commit
27bf566d75
|
|
@ -552,11 +552,15 @@ class Actor:
|
|||
|
||||
'''
|
||||
try:
|
||||
if self._spawn_method == 'trio':
|
||||
parent_data = self._parent_main_data
|
||||
if (
|
||||
self._spawn_method == 'trio'
|
||||
and
|
||||
(parent_data := self._parent_main_data)
|
||||
):
|
||||
if 'init_main_from_name' in parent_data:
|
||||
_mp_fixup_main._fixup_main_from_name(
|
||||
parent_data['init_main_from_name'])
|
||||
|
||||
elif 'init_main_from_path' in parent_data:
|
||||
_mp_fixup_main._fixup_main_from_path(
|
||||
parent_data['init_main_from_path'])
|
||||
|
|
|
|||
Loading…
Reference in New Issue