summaryrefslogtreecommitdiff
path: root/dev-python/ipyparallel/files/ipyparallel-8.6.1-pypy310.patch
blob: fae998d51972c41c3836007d69c761101f7ab7fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From 401980b2a79ef15cc3b35fad51163339c8654751 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Mon, 20 Nov 2023 15:45:04 +0100
Subject: [PATCH] Use pre-3.10 serialization code on PyPy3.10

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
---
 ipyparallel/serialize/codeutil.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ipyparallel/serialize/codeutil.py b/ipyparallel/serialize/codeutil.py
index 2d3acfa2a..80d107765 100644
--- a/ipyparallel/serialize/codeutil.py
+++ b/ipyparallel/serialize/codeutil.py
@@ -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()