Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
d8bcbdac
Commit
d8bcbdac
authored
Dec 25, 2021
by
Matti Picus
Committed by
GitHub
Dec 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapt to upcoming PyPy3.8/9 releases (GH4517)
parent
cb5eb5a1
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
29 additions
and
20 deletions
+29
-20
Cython/Compiler/TypeSlots.py
Cython/Compiler/TypeSlots.py
+1
-1
Cython/Utility/AsyncGen.c
Cython/Utility/AsyncGen.c
+4
-4
Cython/Utility/Coroutine.c
Cython/Utility/Coroutine.c
+4
-4
Cython/Utility/CythonFunction.c
Cython/Utility/CythonFunction.c
+2
-2
tests/build/module_api.srctree
tests/build/module_api.srctree
+2
-1
tests/run/posonly.py
tests/run/posonly.py
+4
-4
tests/run/test_genericclass.py
tests/run/test_genericclass.py
+6
-2
tests/run/test_genericclass_exttype.pyx
tests/run/test_genericclass_exttype.pyx
+6
-2
No files found.
Cython/Compiler/TypeSlots.py
View file @
d8bcbdac
...
...
@@ -1079,7 +1079,7 @@ class SlotTable(object):
EmptySlot
(
"tp_vectorcall"
,
ifdef
=
"PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)"
),
EmptySlot
(
"tp_print"
,
ifdef
=
"PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000"
),
# PyPy specific extension - only here to avoid C compiler warnings.
EmptySlot
(
"tp_pypy_flags"
,
ifdef
=
"CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >
0x0308
0000"
),
EmptySlot
(
"tp_pypy_flags"
,
ifdef
=
"CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >
= 0x0309
0000"
),
)
#------------------------------------------------------------------------------------------
...
...
Cython/Utility/AsyncGen.c
View file @
d8bcbdac
...
...
@@ -463,7 +463,7 @@ static PyTypeObject __pyx_AsyncGenType_type = {
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0
,
/*tp_print*/
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >
0x0308
0000
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >
= 0x0309
0000
0
,
/*tp_pypy_flags*/
#endif
};
...
...
@@ -732,7 +732,7 @@ static PyTypeObject __pyx__PyAsyncGenASendType_type = {
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0
,
/*tp_print*/
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >
0x0308
0000
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >
= 0x0309
0000
0
,
/*tp_pypy_flags*/
#endif
};
...
...
@@ -867,7 +867,7 @@ static PyTypeObject __pyx__PyAsyncGenWrappedValueType_type = {
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0
,
/*tp_print*/
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >
0x0308
0000
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >
= 0x0309
0000
0
,
/*tp_pypy_flags*/
#endif
};
...
...
@@ -1205,7 +1205,7 @@ static PyTypeObject __pyx__PyAsyncGenAThrowType_type = {
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0
,
/*tp_print*/
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >
0x0308
0000
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >
= 0x0309
0000
0
,
/*tp_pypy_flags*/
#endif
};
...
...
Cython/Utility/Coroutine.c
View file @
d8bcbdac
...
...
@@ -1622,7 +1622,7 @@ static PyTypeObject __pyx_CoroutineAwaitType_type = {
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0
,
/*tp_print*/
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >
0x0308
0000
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >
= 0x0309
0000
0
,
/*tp_pypy_flags*/
#endif
};
...
...
@@ -1811,7 +1811,7 @@ static PyTypeObject __pyx_CoroutineType_type = {
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0
,
/*tp_print*/
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >
0x0308
0000
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >
= 0x0309
0000
0
,
/*tp_pypy_flags*/
#endif
};
...
...
@@ -1961,7 +1961,7 @@ static PyTypeObject __pyx_IterableCoroutineType_type = {
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0
,
/*tp_print*/
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >
0x0308
0000
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >
= 0x0309
0000
0
,
/*tp_pypy_flags*/
#endif
};
...
...
@@ -2107,7 +2107,7 @@ static PyTypeObject __pyx_GeneratorType_type = {
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0
,
/*tp_print*/
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >
0x0308
0000
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >
= 0x0309
0000
0
,
/*tp_pypy_flags*/
#endif
};
...
...
Cython/Utility/CythonFunction.c
View file @
d8bcbdac
...
...
@@ -1041,7 +1041,7 @@ static PyTypeObject __pyx_CyFunctionType_type = {
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0
,
/*tp_print*/
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >
0x0308
0000
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >
= 0x0309
0000
0
,
/*tp_pypy_flags*/
#endif
};
...
...
@@ -1582,7 +1582,7 @@ static PyTypeObject __pyx_FusedFunctionType_type = {
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0
,
/*tp_print*/
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >
0x0308
0000
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >
= 0x0309
0000
0
,
/*tp_pypy_flags*/
#endif
};
...
...
tests/build/module_api.srctree
View file @
d8bcbdac
...
...
@@ -108,9 +108,10 @@ void inita(void)
if (!sys_modules) return;
mod = PyInit_a();
if (!mod) return;
#if PY_VERSION_HEX >= 0x03050000
#if PY_VERSION_HEX >= 0x03050000
&& (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
/* FIXME: this is incomplete and users shouldn't have to do this in the first place... */
if (!PyModule_Check(mod)) {
/* In PEP 489 multi-phase init, PyInit_a returns PyModuleDef */
PyModuleDef *mdef = (PyModuleDef*)mod;
PyObject *modname = PyUnicode_FromString("a");
if (!modname) return;
...
...
tests/run/posonly.py
View file @
d8bcbdac
...
...
@@ -107,7 +107,7 @@ def test_use_positional_as_keyword1(a, /):
>>> test_use_positional_as_keyword1(1)
>>> test_use_positional_as_keyword1(a=1) # doctest: +ELLIPSIS
Traceback (most recent call last):
TypeError: test_use_positional_as_keyword1() ... keyword argument
s
...
TypeError: test_use_positional_as_keyword1() ... keyword argument...
"""
def
test_use_positional_as_keyword2
(
a
,
/
,
b
):
...
...
@@ -116,7 +116,7 @@ def test_use_positional_as_keyword2(a, /, b):
>>> test_use_positional_as_keyword2(1, b=2)
>>> test_use_positional_as_keyword2(a=1, b=2) # doctest: +ELLIPSIS
Traceback (most recent call last):
TypeError: test_use_positional_as_keyword2() ... positional...argument
s
...
TypeError: test_use_positional_as_keyword2() ... positional...argument...
"""
def
test_use_positional_as_keyword3
(
a
,
b
,
/
):
...
...
@@ -212,7 +212,7 @@ def test_no_standard_args_usage(a, b, /, *, c):
>>> test_no_standard_args_usage(1, 2, c=3)
>>> test_no_standard_args_usage(1, b=2, c=3) # doctest: +ELLIPSIS
Traceback (most recent call last):
TypeError: test_no_standard_args_usage() ... positional... argument
s
...
TypeError: test_no_standard_args_usage() ... positional... argument...
"""
#def test_change_default_pos_only():
...
...
@@ -383,7 +383,7 @@ def test_serialization2(a, /, b):
(1, 2)
>>> unpickled_optional(a=1, b=2) # doctest: +ELLIPSIS
Traceback (most recent call last):
TypeError: test_serialization2() ... positional... argument
s
...
TypeError: test_serialization2() ... positional... argument...
"""
return
(
a
,
b
)
...
...
tests/run/test_genericclass.py
View file @
d8bcbdac
...
...
@@ -162,8 +162,12 @@ class TestClassGetitem(unittest.TestCase):
# BEGIN - Additional tests from cython
def
test_no_class_getitem
(
self
):
class
C
:
...
# note that PyPy raises AttributeError on __class_getitem__
with
self
.
assertRaises
(
TypeError
if
not
hasattr
(
sys
,
"pypy_version_info"
)
else
AttributeError
):
# PyPy<7.3.8 raises AttributeError on __class_getitem__
if
hasattr
(
sys
,
"pypy_version_info"
)
and
sys
.
pypy_version_info
<
(
7
,
3
,
8
):
err
=
AttributeError
else
:
err
=
TypeError
with
self
.
assertRaises
(
err
):
C
[
int
]
# END - Additional tests from cython
...
...
tests/run/test_genericclass_exttype.pyx
View file @
d8bcbdac
...
...
@@ -51,8 +51,12 @@ cdef class Invalid4:
class
TestClassGetitem
(
unittest
.
TestCase
):
# BEGIN - Additional tests from cython
def
test_no_class_getitem
(
self
):
# note that PyPy raises AttributeError on __class_getitem__
with
self
.
assertRaises
(
TypeError
if
not
hasattr
(
sys
,
"pypy_version_info"
)
else
AttributeError
):
# PyPy<7.3.8 raises AttributeError on __class_getitem__
if
hasattr
(
sys
,
"pypy_version_info"
)
and
sys
.
pypy_version_info
<
(
7
,
3
,
8
):
err
=
AttributeError
else
:
err
=
TypeError
with
self
.
assertRaises
(
err
):
UnSupport
[
int
]
# END - Additional tests from cython
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment