Fix typos + typing in `_mp_fixup_main`
- "spawing" → "spawning", close unbalanced
backtick on `` `start_method='trio'` ``
- "uneeded" → "unneeded", "deats" → "details"
- Remove double `d` annotation; filter
`get_preparation_data()` result into only
`ParentMainData` keys before returning
- Use `pop('authkey', None)` for safety
Review: PR #1 (Copilot)
https://github.com/mahmoudhas/tractor/pull/1#pullrequestreview-4091096072
(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
27bf566d75
commit
a0a7668670
|
|
@ -22,9 +22,9 @@ Now just delegates directly to appropriate `mp.spawn` fns.
|
|||
|
||||
Note
|
||||
----
|
||||
These helpers are needed for any spawing backend that doesn't already
|
||||
These helpers are needed for any spawning backend that doesn't already
|
||||
handle this. For example it's needed when using our
|
||||
`start_method='trio' backend but not when we're already using
|
||||
`start_method='trio'` backend but not when we're already using
|
||||
a ``multiprocessing`` backend such as 'mp_spawn', 'mp_forkserver'.
|
||||
|
||||
?TODO?
|
||||
|
|
@ -68,12 +68,18 @@ def _mp_figure_out_main(
|
|||
if not inherit_parent_main:
|
||||
return {}
|
||||
|
||||
d: ParentMainData
|
||||
proc: mp.Process = mp.current_process()
|
||||
d: dict = get_preparation_data(
|
||||
prep_data: dict = get_preparation_data(
|
||||
name=proc.name,
|
||||
)
|
||||
# XXX, unserializable (and uneeded by us) by default
|
||||
# see `mp.spawn.get_preparation_data()` impl deats.
|
||||
d.pop('authkey')
|
||||
# XXX, unserializable (and unneeded by us) by default
|
||||
# see `mp.spawn.get_preparation_data()` impl details.
|
||||
prep_data.pop('authkey', None)
|
||||
|
||||
d: ParentMainData = {}
|
||||
if 'init_main_from_name' in prep_data:
|
||||
d['init_main_from_name'] = prep_data['init_main_from_name']
|
||||
if 'init_main_from_path' in prep_data:
|
||||
d['init_main_from_path'] = prep_data['init_main_from_path']
|
||||
|
||||
return d
|
||||
|
|
|
|||
Loading…
Reference in New Issue