Skip to content

Commit

Permalink
Merge branch 'trunk' into release-21.2.0-10091
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigc authored Mar 25, 2021
2 parents dc31d00 + 8648459 commit 5c24e99
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 17 deletions.
8 changes: 0 additions & 8 deletions src/twisted/conch/test/test_conch.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from twisted.internet.task import LoopingCall
from twisted.internet.utils import getProcessValue
from twisted.python import filepath, log, runtime
from twisted.python.compat import _PYPY
from twisted.trial.unittest import SkipTest, TestCase
from twisted.conch.test.test_ssh import ConchTestRealm
from twisted.python.procutils import which
Expand Down Expand Up @@ -314,13 +313,6 @@ class ConchServerSetupMixin:
if not pyasn1:
skip = "Cannot run without PyASN1"

# FIXME: https://twistedmatrix.com/trac/ticket/8506

# This should be un-skipped on Travis after the ticket is fixed. For now
# is enabled so that we can continue with fixing other stuff using Travis.
if _PYPY:
skip = "PyPy known_host not working yet on Travis."

@staticmethod
def realmFactory():
return ConchTestRealm(b"testuser")
Expand Down
4 changes: 3 additions & 1 deletion src/twisted/cred/test/test_cred.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,9 @@ def setUp(self):

def hash(self, u: bytes, p: bytes, s: bytes) -> bytes:
hashed_password = crypt(p.decode("ascii"), s.decode("ascii")) # type: ignore[misc]
# workaround for pypy3 3.6.9 which returns bytes from crypt.crypt()
# workaround for pypy3 3.6.9 and above which returns bytes from crypt.crypt()
# This is fixed in pypy3 7.3.5.
# See L{https://foss.heptapod.net/pypy/pypy/-/issues/3395}
if isinstance(hashed_password, bytes):
return hashed_password
return hashed_password.encode("ascii")
Expand Down
6 changes: 3 additions & 3 deletions src/twisted/internet/defer.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from asyncio import AbstractEventLoop, Future, iscoroutine
from enum import Enum
from functools import wraps
from sys import exc_info, implementation, version_info
from sys import exc_info, version_info
import traceback
from types import GeneratorType, MappingProxyType
from typing import (
Expand Down Expand Up @@ -43,7 +43,7 @@
from twisted.logger import Logger
from twisted.python.failure import Failure, _extraneous
from twisted.python import lockfile
from twisted.python.compat import cmp, comparable
from twisted.python.compat import cmp, comparable, _PYPY
from twisted.python.deprecate import deprecated, warnAboutFunction

try:
Expand Down Expand Up @@ -1612,7 +1612,7 @@ def _inlineCallbacks(
# The contextvars backport and our no-op shim add an extra frame.
appCodeTrace = appCodeTrace.tb_next
assert appCodeTrace is not None
elif implementation.name == "pypy":
elif _PYPY:
# PyPy as of 3.7 adds an extra frame.
appCodeTrace = appCodeTrace.tb_next
assert appCodeTrace is not None
Expand Down
3 changes: 0 additions & 3 deletions src/twisted/logger/test/test_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@

from io import StringIO, BytesIO
from typing import Any, IO, List, Optional, Sequence, cast
from unittest import skipIf

from zope.interface import implementer
from zope.interface.exceptions import BrokenMethodImplementation
from zope.interface.verify import verifyObject

from twisted.python.compat import _PYPY
from twisted.python.failure import Failure
from twisted.trial.unittest import TestCase

Expand Down Expand Up @@ -102,7 +100,6 @@ def test_saveNonASCII(self) -> None:
{"\u1234": "\u4321", "3": {"unpersistable": True}},
)

@skipIf(_PYPY, "https://bitbucket.org/pypy/pypy/issues/3052/")
def test_saveBytes(self) -> None:
"""
Any L{bytes} objects will be saved as if they are latin-1 so they can
Expand Down
Empty file.
3 changes: 1 addition & 2 deletions src/twisted/python/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,7 @@ def _get_async_param(isAsync=None, **kwargs):

def _pypy3BlockingHack():
"""
Work around U{this pypy bug
<https://bitbucket.org/pypy/pypy/issues/3051/socketfromfd-sets-sockets-to-blocking-on>}
Work around U{https://foss.heptapod.net/pypy/pypy/-/issues/3051}
by replacing C{socket.fromfd} with a more conservative version.
"""
try:
Expand Down

0 comments on commit 5c24e99

Please sign in to comment.