Skip to content

Commit

Permalink
Merge pull request #1516 from altendky/altendky-10093-returnValue_Dep…
Browse files Browse the repository at this point in the history
…recationWarning_pypy37

Merge pull request #1516 from altendky/altendky-10093-returnValue_DeprecationWarning_pypy37

Author: altendky
Reviewer: rodrigc
Fixes: ticket:10093

This adds PyPy 3.7 to the test matrix and addresses a false positive returnValue() DeprecationWarning when running in PyPy 3.7. This showed up originally in pytest-twisted tests.
  • Loading branch information
altendky committed Feb 16, 2021
2 parents 608108e + a225560 commit a72db25
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
TOXENV: "alldeps-withcov-posix,coverage-prepare,codecov-push,coveralls-push"
strategy:
matrix:
python-version: [3.5, 3.6, 3.7, 3.8, 3.9, pypy3]
python-version: [3.5, 3.6, 3.7, 3.8, 3.9, pypy-3.6, pypy-3.7]

steps:
- uses: actions/checkout@v2
Expand Down
7 changes: 5 additions & 2 deletions src/twisted/internet/defer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import warnings
from asyncio import iscoroutine
from functools import wraps
from sys import exc_info, version_info
from sys import exc_info, implementation, version_info
from typing import Optional

import attr
Expand Down Expand Up @@ -1459,8 +1459,11 @@ def _inlineCallbacks(result, g, status):
# code.
appCodeTrace = exc_info()[2].tb_next

# The contextvars backport and our no-op shim add an extra frame.
if version_info < (3, 7):
# The contextvars backport and our no-op shim add an extra frame.
appCodeTrace = appCodeTrace.tb_next
elif implementation.name == "pypy":
# PyPy as of 3.7 adds an extra frame.
appCodeTrace = appCodeTrace.tb_next

if isFailure:
Expand Down
1 change: 1 addition & 0 deletions src/twisted/newsfragments/10093.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PyPy 3.7 is now tested and supported.

0 comments on commit a72db25

Please sign in to comment.