Skip to content

Commit

Permalink
hoist constant computation and expand explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
glyph committed Jan 14, 2024
1 parent 97eec45 commit f6da08c
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/twisted/internet/defer.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
_T = TypeVar("_T")
_P = ParamSpec("_P")

# See use in _inlineCallbacks for explanation and removal timeline.
_oldPypyStack = _PYPY and implementation.version < (7, 3, 14)


class AlreadyCalledError(Exception):
"""
Expand Down Expand Up @@ -2022,14 +2025,10 @@ def _inlineCallbacks(
appCodeTrace = traceback.tb_next
assert appCodeTrace is not None

_oldPypyStackCompatibility = _PYPY and implementation.version < (
7,
3,
14,
)
if _oldPypyStackCompatibility:
# PyPy before 7.3.14 adds an extra frame.
# This code can be removed once we no longer need to support PyPy 7.3.13 or older.
if _oldPypyStack:
# PyPy versions through 7.3.13 add an extra frame; 7.3.14 fixed
# this discrepancy with CPython. This code can be removed once
# we no longer need to support PyPy 7.3.13 or older.
appCodeTrace = appCodeTrace.tb_next
assert appCodeTrace is not None

Expand Down

0 comments on commit f6da08c

Please sign in to comment.