Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make mypy happy
Browse files Browse the repository at this point in the history
goodboy committed Jan 30, 2022
1 parent 4197f59 commit 5abd4c1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tractor/_debug.py
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@
Callable,
AsyncIterator,
AsyncGenerator,
Iterator,
)

import tractor
@@ -483,7 +484,7 @@ def teardown():


@cm
def _open_pdb() -> PdbwTeardown:
def _open_pdb() -> Iterator[PdbwTeardown]:

# XXX: setting these flags on the pdb instance are absolutely
# critical to having ctrl-c work in the ``trio`` standard way! The
@@ -498,7 +499,8 @@ def _open_pdb() -> PdbwTeardown:
try:
yield pdb
except bdb.BdbQuit:
_pdb_release_hook()
if _pdb_release_hook:
_pdb_release_hook()
raise


@@ -592,13 +594,16 @@ def shield_sigint(
def disable_sigint(
pdb: Optional[PdbwTeardown] = None

) -> None:
) -> Iterator[None]:

__tracebackhide__ = True

# ensure the ``contextlib.contextmanager`` frame inside the wrapping
# ``.__exit__()`` method isn't shown either.
frame = sys._getframe()
frame.f_back.f_globals['__tracebackhide__'] = True
last_f = frame.f_back
if last_f:
last_f.f_globals['__tracebackhide__'] = True
# NOTE: this seems like a form of cpython bug wherein
# it's likely that ``functools.WRAPPER_ASSIGNMENTS`` should
# probably contain this attr name?

0 comments on commit 5abd4c1

Please sign in to comment.