General typing fixes for `mypy`
parent
4dcc21234e
commit
b9eb601265
|
@ -739,13 +739,14 @@ def _set_trace(
|
|||
# last_f.f_globals['__tracebackhide__'] = True
|
||||
|
||||
# start 2 levels up in user code
|
||||
frame: FrameType = sys._getframe()
|
||||
frame: Optional[FrameType] = sys._getframe()
|
||||
if frame:
|
||||
frame = frame.f_back # type: ignore
|
||||
|
||||
if pdb and actor is not None:
|
||||
if frame and pdb and actor is not None:
|
||||
log.pdb(f"\nAttaching pdb to actor: {actor.uid}\n")
|
||||
# no f!#$&* idea!
|
||||
# no f!#$&* idea, but when we're in async land
|
||||
# we need 2x frames up?
|
||||
frame = frame.f_back
|
||||
|
||||
else:
|
||||
|
|
|
@ -307,7 +307,8 @@ async def new_proc(
|
|||
proc: Optional[trio.Process] = None
|
||||
try:
|
||||
try:
|
||||
proc = await trio.lowlevel.open_process(spawn_cmd)
|
||||
# TODO: needs ``trio_typing`` patch?
|
||||
proc = await trio.lowlevel.open_process(spawn_cmd) # type: ignore
|
||||
|
||||
log.runtime(f"Started {proc}")
|
||||
|
||||
|
@ -334,6 +335,9 @@ async def new_proc(
|
|||
await proc.wait()
|
||||
raise
|
||||
|
||||
# a sub-proc ref **must** exist now
|
||||
assert proc
|
||||
|
||||
portal = Portal(chan)
|
||||
actor_nursery._children[subactor.uid] = (
|
||||
subactor, proc, portal)
|
||||
|
|
Loading…
Reference in New Issue