Skip to content

Commit

Permalink
PyPy stack depth check change for 7.3.14
Browse files Browse the repository at this point in the history
  • Loading branch information
mattip committed Jan 14, 2024
1 parent 0010216 commit 8b6c2b7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/twisted/internet/defer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from contextvars import Context as _Context, copy_context as _copy_context
from enum import Enum
from functools import wraps
from sys import exc_info
from sys import exc_info, implementation
from types import CoroutineType, GeneratorType, MappingProxyType, TracebackType
from typing import (
TYPE_CHECKING,
Expand Down Expand Up @@ -54,6 +54,8 @@

log = Logger()

_STACK_LEVEL_INCOMPATIBLE = _PYPY and implementation.version < (7, 3, 14)


_T = TypeVar("_T")
_P = ParamSpec("_P")
Expand Down Expand Up @@ -2022,8 +2024,8 @@ def _inlineCallbacks(
appCodeTrace = traceback.tb_next
assert appCodeTrace is not None

if _PYPY:
# PyPy as of 3.7 adds an extra frame.
if _STACK_LEVEL_INCOMPATIBLE:
# PyPy as of 3.7 and before 7.3.14 adds an extra frame.
appCodeTrace = appCodeTrace.tb_next
assert appCodeTrace is not None

Expand Down

0 comments on commit 8b6c2b7

Please sign in to comment.