Commit 1905f56d authored by Jason Madden's avatar Jason Madden

Fix #1079.

Github Actions upgraded PyPy to 7.3.3 overnight so the tests broke.

TODO: Need to specify exact versions in the GHA config.
parent 215be459
Add support for PyPy2 7.3.3.
......@@ -582,7 +582,7 @@ def __new__(cls, *args, **kw):
try:
# PyPy2/3 and CPython handle adding a __new__ to the class
# in different ways. In CPython and PyPy3, it must be wrapped with classmethod;
# in PyPy2, it must not. In either case, the args that get passed to
# in PyPy2 < 7.3.3, it must not. In either case, the args that get passed to
# it are stil wrong.
local.__new__ = 'None'
except TypeError: # pragma: no cover
......@@ -592,7 +592,13 @@ else:
from gevent._compat import PYPY
from gevent._compat import PY2
if PYPY and PY2:
# The behaviour changed with no warning between PyPy2 7.3.2 and 7.3.3.
local.__new__ = __new__
try:
local() # <= 7.3.2
except TypeError:
# >= 7.3.3
local.__new__ = classmethod(__new__)
else:
local.__new__ = classmethod(__new__)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment