Skip to content

Commit 8232baf

Browse files
authored
Merge pull request #934 from mgorny/pypy311
Use new serialization code for PyPy3.10+ 7.3.19+
2 parents 0d5488f + 97b74a0 commit 8232baf

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ipyparallel/serialize/codeutil.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,16 @@ def code_ctor(*args):
2929
# pass every supported arg to the code constructor
3030
# this should be more forward-compatible
3131
# (broken on pypy: https://github.com/ipython/ipyparallel/issues/845)
32-
if sys.version_info >= (3, 10) and not hasattr(sys, "pypy_version_info"):
32+
if sys.version_info >= (3, 10) and getattr(sys, "pypy_version_info", (7, 3, 19)) >= (
33+
7,
34+
3,
35+
19,
36+
):
3337
_code_attr_names = tuple(
3438
_code_attr_map.get(name, name)
3539
for name, param in inspect.signature(types.CodeType).parameters.items()
36-
if param.POSITIONAL_ONLY or param.POSITIONAL_OR_KEYWORD
40+
if (param.POSITIONAL_ONLY or param.POSITIONAL_OR_KEYWORD)
41+
and not (hasattr(sys, "pypy_version_info") and name == "magic")
3742
)
3843
else:
3944
# can't inspect types.CodeType on Python < 3.10

0 commit comments

Comments
 (0)