Skip to content

Commit

Permalink
Use pre-3.10 serialization code on PyPy3.10
Browse files Browse the repository at this point in the history
The new serialization code for Python 3.10+ does not seem to work
on PyPy3.10 7.3.13, as it causes:

    ValueError: no signature found for builtin type <class 'code'>

Switch back to the old code if PyPy is used, at least for the time
being.  With this change, the test suite passes on PyPy3.10.

Fixes #845
  • Loading branch information
mgorny committed Nov 20, 2023
1 parent 44dab1c commit 401980b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ipyparallel/serialize/codeutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ def code_ctor(*args):
}
# pass every supported arg to the code constructor
# this should be more forward-compatible
if sys.version_info >= (3, 10):
# (broken on pypy: https://github.com/ipython/ipyparallel/issues/845)
if sys.version_info >= (3, 10) and not hasattr(sys, "pypy_version_info"):
_code_attr_names = tuple(
_code_attr_map.get(name, name)
for name, param in inspect.signature(types.CodeType).parameters.items()
Expand Down

0 comments on commit 401980b

Please sign in to comment.