forked from pool/python-greenlet
Compare commits
101 Commits
Author | SHA256 | Date | |
---|---|---|---|
|
bf998562ec | ||
8bf8bc8e02 | |||
3932fde8ad | |||
|
30b70de50d | ||
|
25d3f2776e | ||
1196ca397c | |||
|
9fbf3594c4 | ||
f649e6bd60 | |||
|
8f9402fcc8 | ||
66d4b43fa1 | |||
|
a5ca70a2ac | ||
08a518ef1d | |||
|
0b57f920b9 | ||
4b955fc182 | |||
|
a3e20d620e | ||
faff34589b | |||
1667d27fdb | |||
|
bf5000bb93 | ||
682db7c4ad | |||
|
8d32e7b726 | ||
1211730c98 | |||
|
815d2d64b6 | ||
e0dc7350cf | |||
|
ddf60cf7c2 | ||
2983b265ea | |||
a811b69253 | |||
7b7c2f8345 | |||
|
475da946ab | ||
d9107d3581 | |||
|
97d77111f4 | ||
0031e4d6b3 | |||
|
2e54c2c677 | ||
5b350ff128 | |||
|
a892773d85 | ||
347d7c3a6a | |||
|
4161110e81 | ||
acd5034be6 | |||
|
b621e56a30 | ||
236f62427d | |||
|
fdd8e0d9a4 | ||
f027d24c76 | |||
e19449235b | |||
20e1d883fe | |||
70d6633dbf | |||
|
a7844d4d6f | ||
|
4e11fa10b9 | ||
|
d6a7e4e7d6 | ||
|
fb67797bc6 | ||
|
83f2483131 | ||
|
5e8d0b2102 | ||
|
1690d85586 | ||
|
e9068dfa18 | ||
|
51d4b5e111 | ||
|
69b3b5cebd | ||
|
867321b8a2 | ||
41ca1378b8 | |||
|
4b8562b21f | ||
3c581346e2 | |||
|
a18aec18ba | ||
|
41ddf6532f | ||
|
3cb78e603a | ||
|
efeb6d5178 | ||
|
a9afed4e90 | ||
|
6f1db46cf8 | ||
|
8726382096 | ||
|
86eb86c72c | ||
|
5a722c2641 | ||
|
b23701b912 | ||
3cacd665cc | |||
|
d8d1abf2b9 | ||
|
24a4161f99 | ||
|
6f9c19a92d | ||
|
8d8ac9ca52 | ||
|
aa7229861a | ||
|
dc9a391941 | ||
|
510d4db539 | ||
|
aef436890b | ||
|
843b709da4 | ||
|
7004e96ef3 | ||
|
b5e6010974 | ||
|
e39e653574 | ||
|
ab50b7e895 | ||
|
887d060850 | ||
|
afaaec4e13 | ||
|
a1e4200c4c | ||
|
639506ea46 | ||
|
03cffffa64 | ||
|
74d4cd0753 | ||
|
f03f4f188f | ||
|
2c4c5acf9d | ||
|
25f1f81287 | ||
|
f3ee8baec8 | ||
|
0fa06d5c88 | ||
|
dd66a1b06b | ||
|
34604376fc | ||
|
9a477dd2db | ||
|
8bbd668131 | ||
|
887feec87c | ||
78de2ff214 | |||
799f3a9ad9 | |||
|
fa16d9583a |
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:43374442353259554ce33599da8b692d5aa96f8976d567d4badf263371fbe491
|
|
||||||
size 182013
|
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:b395121e9bbe8d02a750886f108d540abe66075e61e22f7353d9acb0b81be0f0
|
|
||||||
size 183954
|
|
BIN
greenlet-3.1.1.tar.gz
(Stored with Git LFS)
Normal file
BIN
greenlet-3.1.1.tar.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -1,454 +0,0 @@
|
|||||||
From 94979488f841fcb41bd2bd3b80b5c0b011af4c94 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Victor Stinner <vstinner@python.org>
|
|
||||||
Date: Wed, 14 Feb 2024 16:37:42 +0100
|
|
||||||
Subject: [PATCH 1/8] Fix #392: Port to Python 3.13
|
|
||||||
|
|
||||||
* Replace C_RECURSION_LIMIT with Py_C_RECURSION_LIMIT.
|
|
||||||
* Add Py_C_RECURSION_LIMIT for Python 3.12 and older.
|
|
||||||
* Disable GREENLET_USE_CFRAME on Python 3.13.
|
|
||||||
* Define Py_BUILD_CORE to include pycore_frame.h.
|
|
||||||
---
|
|
||||||
src/greenlet/TPythonState.cpp | 10 +++++++---
|
|
||||||
src/greenlet/greenlet_cpython_compat.hpp | 13 +++++++++++--
|
|
||||||
src/greenlet/greenlet_greenlet.hpp | 1 +
|
|
||||||
3 files changed, 19 insertions(+), 5 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/greenlet/TPythonState.cpp b/src/greenlet/TPythonState.cpp
|
|
||||||
index 465d4174..c0dbf703 100644
|
|
||||||
--- a/src/greenlet/TPythonState.cpp
|
|
||||||
+++ b/src/greenlet/TPythonState.cpp
|
|
||||||
@@ -130,11 +130,13 @@ void PythonState::operator<<(const PyThreadState *const tstate) noexcept
|
|
||||||
#if GREENLET_PY311
|
|
||||||
#if GREENLET_PY312
|
|
||||||
this->py_recursion_depth = tstate->py_recursion_limit - tstate->py_recursion_remaining;
|
|
||||||
- this->c_recursion_depth = C_RECURSION_LIMIT - tstate->c_recursion_remaining;
|
|
||||||
+ this->c_recursion_depth = Py_C_RECURSION_LIMIT - tstate->c_recursion_remaining;
|
|
||||||
#else // not 312
|
|
||||||
this->recursion_depth = tstate->recursion_limit - tstate->recursion_remaining;
|
|
||||||
#endif // GREENLET_PY312
|
|
||||||
+ #if GREENLET_USE_CFRAME
|
|
||||||
this->current_frame = tstate->cframe->current_frame;
|
|
||||||
+ #endif
|
|
||||||
this->datastack_chunk = tstate->datastack_chunk;
|
|
||||||
this->datastack_top = tstate->datastack_top;
|
|
||||||
this->datastack_limit = tstate->datastack_limit;
|
|
||||||
@@ -199,12 +201,14 @@ void PythonState::operator>>(PyThreadState *const tstate) noexcept
|
|
||||||
#if GREENLET_PY311
|
|
||||||
#if GREENLET_PY312
|
|
||||||
tstate->py_recursion_remaining = tstate->py_recursion_limit - this->py_recursion_depth;
|
|
||||||
- tstate->c_recursion_remaining = C_RECURSION_LIMIT - this->c_recursion_depth;
|
|
||||||
+ tstate->c_recursion_remaining = Py_C_RECURSION_LIMIT - this->c_recursion_depth;
|
|
||||||
this->unexpose_frames();
|
|
||||||
#else // \/ 3.11
|
|
||||||
tstate->recursion_remaining = tstate->recursion_limit - this->recursion_depth;
|
|
||||||
#endif // GREENLET_PY312
|
|
||||||
+ #if GREENLET_USE_CFRAME
|
|
||||||
tstate->cframe->current_frame = this->current_frame;
|
|
||||||
+ #endif
|
|
||||||
tstate->datastack_chunk = this->datastack_chunk;
|
|
||||||
tstate->datastack_top = this->datastack_top;
|
|
||||||
tstate->datastack_limit = this->datastack_limit;
|
|
||||||
@@ -238,7 +242,7 @@ void PythonState::set_initial_state(const PyThreadState* const tstate) noexcept
|
|
||||||
#if GREENLET_PY312
|
|
||||||
this->py_recursion_depth = tstate->py_recursion_limit - tstate->py_recursion_remaining;
|
|
||||||
// XXX: TODO: Comment from a reviewer:
|
|
||||||
- // Should this be ``C_RECURSION_LIMIT - tstate->c_recursion_remaining``?
|
|
||||||
+ // Should this be ``Py_C_RECURSION_LIMIT - tstate->c_recursion_remaining``?
|
|
||||||
// But to me it looks more like that might not be the right
|
|
||||||
// initialization either?
|
|
||||||
this->c_recursion_depth = tstate->py_recursion_limit - tstate->py_recursion_remaining;
|
|
||||||
diff --git a/src/greenlet/greenlet_cpython_compat.hpp b/src/greenlet/greenlet_cpython_compat.hpp
|
|
||||||
index cdc1617f..c0fb94c5 100644
|
|
||||||
--- a/src/greenlet/greenlet_cpython_compat.hpp
|
|
||||||
+++ b/src/greenlet/greenlet_cpython_compat.hpp
|
|
||||||
@@ -12,19 +12,24 @@
|
|
||||||
|
|
||||||
#if PY_VERSION_HEX >= 0x30A00B1
|
|
||||||
# define GREENLET_PY310 1
|
|
||||||
+#else
|
|
||||||
+# define GREENLET_PY310 0
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
/*
|
|
||||||
Python 3.10 beta 1 changed tstate->use_tracing to a nested cframe member.
|
|
||||||
See https://github.com/python/cpython/pull/25276
|
|
||||||
We have to save and restore this as well.
|
|
||||||
+
|
|
||||||
+Python 3.13 removed PyThreadState.cframe (GH-108035).
|
|
||||||
*/
|
|
||||||
+#if GREENLET_PY310 && PY_VERSION_HEX < 0x30D0000
|
|
||||||
# define GREENLET_USE_CFRAME 1
|
|
||||||
#else
|
|
||||||
# define GREENLET_USE_CFRAME 0
|
|
||||||
-# define GREENLET_PY310 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
-
|
|
||||||
#if PY_VERSION_HEX >= 0x30B00A4
|
|
||||||
/*
|
|
||||||
Greenlet won't compile on anything older than Python 3.11 alpha 4 (see
|
|
||||||
@@ -124,4 +129,8 @@ static inline void PyThreadState_LeaveTracing(PyThreadState *tstate)
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+#if !defined(Py_C_RECURSION_LIMIT) && defined(C_RECURSION_LIMIT)
|
|
||||||
+# define Py_C_RECURSION_LIMIT C_RECURSION_LIMIT
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
#endif /* GREENLET_CPYTHON_COMPAT_H */
|
|
||||||
diff --git a/src/greenlet/greenlet_greenlet.hpp b/src/greenlet/greenlet_greenlet.hpp
|
|
||||||
index d52ce1fd..6da6841f 100644
|
|
||||||
--- a/src/greenlet/greenlet_greenlet.hpp
|
|
||||||
+++ b/src/greenlet/greenlet_greenlet.hpp
|
|
||||||
@@ -23,6 +23,7 @@ using greenlet::refs::BorrowedGreenlet;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if GREENLET_PY312
|
|
||||||
+# define Py_BUILD_CORE
|
|
||||||
# include "internal/pycore_frame.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
From ee2f0c3e99a1cf65cd84b762f6cfcb997b873877 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Victor Stinner <vstinner@python.org>
|
|
||||||
Date: Wed, 14 Feb 2024 16:45:56 +0100
|
|
||||||
Subject: [PATCH 2/8] Add Python 3.13 CI to GitHub Actions
|
|
||||||
|
|
||||||
---
|
|
||||||
.github/workflows/tests.yml | 3 ++-
|
|
||||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
|
|
||||||
index 66b2e458..29e84db0 100644
|
|
||||||
--- a/.github/workflows/tests.yml
|
|
||||||
+++ b/.github/workflows/tests.yml
|
|
||||||
@@ -25,7 +25,7 @@ jobs:
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
- python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
|
|
||||||
+ python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12", "3.13"]
|
|
||||||
os: [ubuntu-latest, macos-latest]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
@@ -35,6 +35,7 @@ jobs:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
cache-dependency-path: setup.py
|
|
||||||
+ allow-prereleases: true
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
python -m pip install -U pip setuptools wheel
|
|
||||||
|
|
||||||
From 00611d7567d09869973fe314f60575674cc877d8 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Victor Stinner <vstinner@python.org>
|
|
||||||
Date: Mon, 3 Jun 2024 10:55:14 +0200
|
|
||||||
Subject: [PATCH 3/8] Support delete_later
|
|
||||||
|
|
||||||
---
|
|
||||||
src/greenlet/TPythonState.cpp | 14 ++++++++++++--
|
|
||||||
src/greenlet/greenlet.cpp | 4 ++++
|
|
||||||
src/greenlet/greenlet_cpython_compat.hpp | 6 ++++++
|
|
||||||
src/greenlet/greenlet_greenlet.hpp | 4 ++++
|
|
||||||
4 files changed, 26 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/greenlet/TPythonState.cpp b/src/greenlet/TPythonState.cpp
|
|
||||||
index c0dbf703..bfb40cac 100644
|
|
||||||
--- a/src/greenlet/TPythonState.cpp
|
|
||||||
+++ b/src/greenlet/TPythonState.cpp
|
|
||||||
@@ -18,7 +18,11 @@ PythonState::PythonState()
|
|
||||||
#else
|
|
||||||
,recursion_depth(0)
|
|
||||||
#endif
|
|
||||||
+#if GREENLET_PY313
|
|
||||||
+ ,delete_later(nullptr)
|
|
||||||
+#else
|
|
||||||
,trash_delete_nesting(0)
|
|
||||||
+#endif
|
|
||||||
#if GREENLET_PY311
|
|
||||||
,current_frame(nullptr)
|
|
||||||
,datastack_chunk(nullptr)
|
|
||||||
@@ -145,7 +149,9 @@ void PythonState::operator<<(const PyThreadState *const tstate) noexcept
|
|
||||||
Py_XDECREF(frame); // PyThreadState_GetFrame gives us a new
|
|
||||||
// reference.
|
|
||||||
this->_top_frame.steal(frame);
|
|
||||||
- #if GREENLET_PY312
|
|
||||||
+ #if GREENLET_PY313
|
|
||||||
+ this->delete_later = Py_XNewRef(tstate->delete_later);
|
|
||||||
+ #elif GREENLET_PY312
|
|
||||||
this->trash_delete_nesting = tstate->trash.delete_nesting;
|
|
||||||
#else // not 312
|
|
||||||
this->trash_delete_nesting = tstate->trash_delete_nesting;
|
|
||||||
@@ -213,7 +219,11 @@ void PythonState::operator>>(PyThreadState *const tstate) noexcept
|
|
||||||
tstate->datastack_top = this->datastack_top;
|
|
||||||
tstate->datastack_limit = this->datastack_limit;
|
|
||||||
this->_top_frame.relinquish_ownership();
|
|
||||||
- #if GREENLET_PY312
|
|
||||||
+ #if GREENLET_PY313
|
|
||||||
+ Py_XDECREF(tstate->delete_later);
|
|
||||||
+ tstate->delete_later = this->delete_later;
|
|
||||||
+ Py_CLEAR(this->delete_later);
|
|
||||||
+ #elif GREENLET_PY312
|
|
||||||
tstate->trash.delete_nesting = this->trash_delete_nesting;
|
|
||||||
#else // not 3.12
|
|
||||||
tstate->trash_delete_nesting = this->trash_delete_nesting;
|
|
||||||
diff --git a/src/greenlet/greenlet.cpp b/src/greenlet/greenlet.cpp
|
|
||||||
index 5a9818e8..dfc748a8 100644
|
|
||||||
--- a/src/greenlet/greenlet.cpp
|
|
||||||
+++ b/src/greenlet/greenlet.cpp
|
|
||||||
@@ -1328,6 +1328,7 @@ mod_enable_optional_cleanup(PyObject* UNUSED(module), PyObject* flag)
|
|
||||||
Py_RETURN_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
+#if !GREENLET_PY313
|
|
||||||
PyDoc_STRVAR(mod_get_tstate_trash_delete_nesting_doc,
|
|
||||||
"get_tstate_trash_delete_nesting() -> Integer\n"
|
|
||||||
"\n"
|
|
||||||
@@ -1343,6 +1344,7 @@ mod_get_tstate_trash_delete_nesting(PyObject* UNUSED(module))
|
|
||||||
return PyLong_FromLong(tstate->trash_delete_nesting);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
static PyMethodDef GreenMethods[] = {
|
|
||||||
{"getcurrent",
|
|
||||||
@@ -1356,7 +1358,9 @@ static PyMethodDef GreenMethods[] = {
|
|
||||||
{"get_total_main_greenlets", (PyCFunction)mod_get_total_main_greenlets, METH_NOARGS, mod_get_total_main_greenlets_doc},
|
|
||||||
{"get_clocks_used_doing_optional_cleanup", (PyCFunction)mod_get_clocks_used_doing_optional_cleanup, METH_NOARGS, mod_get_clocks_used_doing_optional_cleanup_doc},
|
|
||||||
{"enable_optional_cleanup", (PyCFunction)mod_enable_optional_cleanup, METH_O, mod_enable_optional_cleanup_doc},
|
|
||||||
+#if !GREENLET_PY313
|
|
||||||
{"get_tstate_trash_delete_nesting", (PyCFunction)mod_get_tstate_trash_delete_nesting, METH_NOARGS, mod_get_tstate_trash_delete_nesting_doc},
|
|
||||||
+#endif
|
|
||||||
{NULL, NULL} /* Sentinel */
|
|
||||||
};
|
|
||||||
|
|
||||||
diff --git a/src/greenlet/greenlet_cpython_compat.hpp b/src/greenlet/greenlet_cpython_compat.hpp
|
|
||||||
index c0fb94c5..ce5fd882 100644
|
|
||||||
--- a/src/greenlet/greenlet_cpython_compat.hpp
|
|
||||||
+++ b/src/greenlet/greenlet_cpython_compat.hpp
|
|
||||||
@@ -55,6 +55,12 @@ Greenlet won't compile on anything older than Python 3.11 alpha 4 (see
|
|
||||||
# define GREENLET_PY312 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+#if PY_VERSION_HEX >= 0x30D0000
|
|
||||||
+# define GREENLET_PY313 1
|
|
||||||
+#else
|
|
||||||
+# define GREENLET_PY313 0
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
#ifndef Py_SET_REFCNT
|
|
||||||
/* Py_REFCNT and Py_SIZE macros are converted to functions
|
|
||||||
https://bugs.python.org/issue39573 */
|
|
||||||
diff --git a/src/greenlet/greenlet_greenlet.hpp b/src/greenlet/greenlet_greenlet.hpp
|
|
||||||
index 6da6841f..fbfdfbfc 100644
|
|
||||||
--- a/src/greenlet/greenlet_greenlet.hpp
|
|
||||||
+++ b/src/greenlet/greenlet_greenlet.hpp
|
|
||||||
@@ -111,7 +111,11 @@ namespace greenlet
|
|
||||||
#else
|
|
||||||
int recursion_depth;
|
|
||||||
#endif
|
|
||||||
+#if GREENLET_PY313
|
|
||||||
+ PyObject *delete_later;
|
|
||||||
+#else
|
|
||||||
int trash_delete_nesting;
|
|
||||||
+#endif
|
|
||||||
#if GREENLET_PY311
|
|
||||||
_PyInterpreterFrame* current_frame;
|
|
||||||
_PyStackChunk* datastack_chunk;
|
|
||||||
|
|
||||||
From b65558ec962d3d81ae09787ebca8686d233e2a4c Mon Sep 17 00:00:00 2001
|
|
||||||
From: Victor Stinner <vstinner@python.org>
|
|
||||||
Date: Wed, 5 Jun 2024 12:04:21 +0200
|
|
||||||
Subject: [PATCH 4/8] Fix current_frame
|
|
||||||
|
|
||||||
---
|
|
||||||
src/greenlet/TPythonState.cpp | 8 ++++++--
|
|
||||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/greenlet/TPythonState.cpp b/src/greenlet/TPythonState.cpp
|
|
||||||
index bfb40cac..82eb34f0 100644
|
|
||||||
--- a/src/greenlet/TPythonState.cpp
|
|
||||||
+++ b/src/greenlet/TPythonState.cpp
|
|
||||||
@@ -138,7 +138,9 @@ void PythonState::operator<<(const PyThreadState *const tstate) noexcept
|
|
||||||
#else // not 312
|
|
||||||
this->recursion_depth = tstate->recursion_limit - tstate->recursion_remaining;
|
|
||||||
#endif // GREENLET_PY312
|
|
||||||
- #if GREENLET_USE_CFRAME
|
|
||||||
+ #if GREENLET_PY313
|
|
||||||
+ this->current_frame = tstate->current_frame;
|
|
||||||
+ #elif GREENLET_USE_CFRAME
|
|
||||||
this->current_frame = tstate->cframe->current_frame;
|
|
||||||
#endif
|
|
||||||
this->datastack_chunk = tstate->datastack_chunk;
|
|
||||||
@@ -212,7 +214,9 @@ void PythonState::operator>>(PyThreadState *const tstate) noexcept
|
|
||||||
#else // \/ 3.11
|
|
||||||
tstate->recursion_remaining = tstate->recursion_limit - this->recursion_depth;
|
|
||||||
#endif // GREENLET_PY312
|
|
||||||
- #if GREENLET_USE_CFRAME
|
|
||||||
+ #if GREENLET_PY313
|
|
||||||
+ tstate->current_frame = this->current_frame;
|
|
||||||
+ #elif GREENLET_USE_CFRAME
|
|
||||||
tstate->cframe->current_frame = this->current_frame;
|
|
||||||
#endif
|
|
||||||
tstate->datastack_chunk = this->datastack_chunk;
|
|
||||||
|
|
||||||
From b7cfc1748766cac351fe5fca32fa7c8cacdea2ae Mon Sep 17 00:00:00 2001
|
|
||||||
From: Victor Stinner <vstinner@python.org>
|
|
||||||
Date: Wed, 5 Jun 2024 12:17:28 +0200
|
|
||||||
Subject: [PATCH 5/8] Update tests
|
|
||||||
|
|
||||||
---
|
|
||||||
src/greenlet/tests/test_greenlet.py | 4 +++-
|
|
||||||
src/greenlet/tests/test_greenlet_trash.py | 9 +++++++++
|
|
||||||
2 files changed, 12 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/greenlet/tests/test_greenlet.py b/src/greenlet/tests/test_greenlet.py
|
|
||||||
index 51849cd6..259707ae 100644
|
|
||||||
--- a/src/greenlet/tests/test_greenlet.py
|
|
||||||
+++ b/src/greenlet/tests/test_greenlet.py
|
|
||||||
@@ -471,7 +471,9 @@ def creator():
|
|
||||||
# Unfortunately, this doesn't actually clear the references, they're in the
|
|
||||||
# fast local array.
|
|
||||||
if not wait_for_cleanup:
|
|
||||||
- result[0].gr_frame.f_locals.clear()
|
|
||||||
+ # f_locals has no clear method in Python 3.13
|
|
||||||
+ if hasattr(result[0].gr_frame.f_locals, 'clear'):
|
|
||||||
+ result[0].gr_frame.f_locals.clear()
|
|
||||||
else:
|
|
||||||
self.assertIsNone(result[0].gr_frame)
|
|
||||||
|
|
||||||
diff --git a/src/greenlet/tests/test_greenlet_trash.py b/src/greenlet/tests/test_greenlet_trash.py
|
|
||||||
index 8d9716e9..2bce8fd0 100644
|
|
||||||
--- a/src/greenlet/tests/test_greenlet_trash.py
|
|
||||||
+++ b/src/greenlet/tests/test_greenlet_trash.py
|
|
||||||
@@ -29,8 +29,17 @@
|
|
||||||
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
+try:
|
|
||||||
+ from greenlet._greenlet import get_tstate_trash_delete_nesting
|
|
||||||
+except ImportError:
|
|
||||||
+ get_tstate_trash_delete_nesting = None
|
|
||||||
+
|
|
||||||
+
|
|
||||||
class TestTrashCanReEnter(unittest.TestCase):
|
|
||||||
|
|
||||||
+ # Python 3.13 has not "trash delete nesting" anymore (but "delete later")
|
|
||||||
+ @unittest.skipIf(get_tstate_trash_delete_nesting is None,
|
|
||||||
+ 'need get_tstate_trash_delete_nesting()')
|
|
||||||
def test_it(self):
|
|
||||||
# Try several times to trigger it, because it isn't 100%
|
|
||||||
# reliable.
|
|
||||||
|
|
||||||
From 9b683398a91813fe861d9fc1e283b72bc17bfa61 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jason Madden <jamadden@gmail.com>
|
|
||||||
Date: Wed, 4 Sep 2024 12:20:45 -0500
|
|
||||||
Subject: [PATCH 6/8] Update test_greenlet_trash.py to avoid redefining
|
|
||||||
variables
|
|
||||||
|
|
||||||
---
|
|
||||||
src/greenlet/tests/test_greenlet_trash.py | 16 +++++++---------
|
|
||||||
1 file changed, 7 insertions(+), 9 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/greenlet/tests/test_greenlet_trash.py b/src/greenlet/tests/test_greenlet_trash.py
|
|
||||||
index 2bce8fd0..a3f58b7f 100644
|
|
||||||
--- a/src/greenlet/tests/test_greenlet_trash.py
|
|
||||||
+++ b/src/greenlet/tests/test_greenlet_trash.py
|
|
||||||
@@ -29,18 +29,17 @@
|
|
||||||
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
-try:
|
|
||||||
- from greenlet._greenlet import get_tstate_trash_delete_nesting
|
|
||||||
-except ImportError:
|
|
||||||
- get_tstate_trash_delete_nesting = None
|
|
||||||
-
|
|
||||||
|
|
||||||
class TestTrashCanReEnter(unittest.TestCase):
|
|
||||||
|
|
||||||
- # Python 3.13 has not "trash delete nesting" anymore (but "delete later")
|
|
||||||
- @unittest.skipIf(get_tstate_trash_delete_nesting is None,
|
|
||||||
- 'need get_tstate_trash_delete_nesting()')
|
|
||||||
def test_it(self):
|
|
||||||
+ try:
|
|
||||||
+ from greenlet._greenlet import get_tstate_trash_delete_nesting
|
|
||||||
+ except ImportError:
|
|
||||||
+ import sys
|
|
||||||
+ # Python 3.13 has not "trash delete nesting" anymore (but "delete later")
|
|
||||||
+ assert sys.version_info[:2] >= (3, 13)
|
|
||||||
+ self.skipTest("get_tstate_trash_delete_nesting is not available.")
|
|
||||||
# Try several times to trigger it, because it isn't 100%
|
|
||||||
# reliable.
|
|
||||||
for _ in range(10):
|
|
||||||
@@ -48,7 +47,6 @@ def test_it(self):
|
|
||||||
|
|
||||||
def check_it(self): # pylint:disable=too-many-statements
|
|
||||||
import greenlet
|
|
||||||
- from greenlet._greenlet import get_tstate_trash_delete_nesting # pylint:disable=no-name-in-module
|
|
||||||
|
|
||||||
main = greenlet.getcurrent()
|
|
||||||
|
|
||||||
|
|
||||||
From 3d0f50129c4f889899e3ce341089a139241ef15b Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jason Madden <jamadden@gmail.com>
|
|
||||||
Date: Wed, 4 Sep 2024 12:27:01 -0500
|
|
||||||
Subject: [PATCH 7/8] D'oh, removed one too many.
|
|
||||||
|
|
||||||
---
|
|
||||||
src/greenlet/tests/test_greenlet_trash.py | 5 +++--
|
|
||||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/greenlet/tests/test_greenlet_trash.py b/src/greenlet/tests/test_greenlet_trash.py
|
|
||||||
index a3f58b7f..c734b983 100644
|
|
||||||
--- a/src/greenlet/tests/test_greenlet_trash.py
|
|
||||||
+++ b/src/greenlet/tests/test_greenlet_trash.py
|
|
||||||
@@ -34,7 +34,8 @@ class TestTrashCanReEnter(unittest.TestCase):
|
|
||||||
|
|
||||||
def test_it(self):
|
|
||||||
try:
|
|
||||||
- from greenlet._greenlet import get_tstate_trash_delete_nesting
|
|
||||||
+ # pylint:disable-next=no-name-in-module
|
|
||||||
+ from greenlet._greenlet import get_tstate_trash_delete_nesting
|
|
||||||
except ImportError:
|
|
||||||
import sys
|
|
||||||
# Python 3.13 has not "trash delete nesting" anymore (but "delete later")
|
|
||||||
@@ -47,7 +48,7 @@ def test_it(self):
|
|
||||||
|
|
||||||
def check_it(self): # pylint:disable=too-many-statements
|
|
||||||
import greenlet
|
|
||||||
-
|
|
||||||
+ from greenlet._greenlet import get_tstate_trash_delete_nesting # pylint:disable=no-name-in-module
|
|
||||||
main = greenlet.getcurrent()
|
|
||||||
|
|
||||||
assert get_tstate_trash_delete_nesting() == 0
|
|
||||||
|
|
||||||
From 3ce88eb9e5e153b3c8d2fb837441810e5a9cb144 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jason Madden <jamadden@gmail.com>
|
|
||||||
Date: Wed, 4 Sep 2024 12:42:19 -0500
|
|
||||||
Subject: [PATCH 8/8] Trailing whitespace makes the linter mad. Thanks GitHub
|
|
||||||
web editor.
|
|
||||||
|
|
||||||
---
|
|
||||||
src/greenlet/tests/test_greenlet_trash.py | 3 ++-
|
|
||||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/greenlet/tests/test_greenlet_trash.py b/src/greenlet/tests/test_greenlet_trash.py
|
|
||||||
index c734b983..c1fc1374 100644
|
|
||||||
--- a/src/greenlet/tests/test_greenlet_trash.py
|
|
||||||
+++ b/src/greenlet/tests/test_greenlet_trash.py
|
|
||||||
@@ -35,12 +35,13 @@ class TestTrashCanReEnter(unittest.TestCase):
|
|
||||||
def test_it(self):
|
|
||||||
try:
|
|
||||||
# pylint:disable-next=no-name-in-module
|
|
||||||
- from greenlet._greenlet import get_tstate_trash_delete_nesting
|
|
||||||
+ from greenlet._greenlet import get_tstate_trash_delete_nesting # pylint:disable=unused-import
|
|
||||||
except ImportError:
|
|
||||||
import sys
|
|
||||||
# Python 3.13 has not "trash delete nesting" anymore (but "delete later")
|
|
||||||
assert sys.version_info[:2] >= (3, 13)
|
|
||||||
self.skipTest("get_tstate_trash_delete_nesting is not available.")
|
|
||||||
+
|
|
||||||
# Try several times to trigger it, because it isn't 100%
|
|
||||||
# reliable.
|
|
||||||
for _ in range(10):
|
|
@ -1,3 +1,23 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Sep 27 10:27:38 UTC 2024 - ecsos <ecsos@opensuse.org>
|
||||||
|
|
||||||
|
- Fix build error under Leap.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Sep 26 13:37:06 UTC 2024 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
|
||||||
|
|
||||||
|
- Update to 3.1.1
|
||||||
|
* Fix crashes on 32-bit PPC Linux. Note that there is no CI for this,
|
||||||
|
and support is best effort; there may be other issues lurking.
|
||||||
|
* Remove unnecessary logging sometimes during interpreter shutdown.
|
||||||
|
* Fix some crashes on 32-bit PPC MacOS. This is a very old platform,
|
||||||
|
and is only known to be tested on beta versions of an operating
|
||||||
|
system that was never released, using the GCC 14 only provided by
|
||||||
|
MacPorts; it may or may not work on the final MacOS X release that
|
||||||
|
supported 32-bit PowerPC. It has the known issue of leaking memory
|
||||||
|
when greenlets are used in multiple threads. Help debugging this
|
||||||
|
would be appreciated.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Sep 10 20:44:39 UTC 2024 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
|
Tue Sep 10 20:44:39 UTC 2024 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
%{?sle15_python_module_pythons}
|
%{?sle15_python_module_pythons}
|
||||||
Name: python-greenlet
|
Name: python-greenlet
|
||||||
Version: 3.1.0
|
Version: 3.1.1
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Lightweight in-process concurrent programming
|
Summary: Lightweight in-process concurrent programming
|
||||||
License: MIT
|
License: MIT
|
||||||
@ -36,7 +36,13 @@ BuildRequires: %{python_module pip}
|
|||||||
BuildRequires: %{python_module psutil}
|
BuildRequires: %{python_module psutil}
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
BuildRequires: %{python_module wheel}
|
BuildRequires: %{python_module wheel}
|
||||||
BuildRequires: c++_compiler
|
%if 0%{?suse_version} < 1600
|
||||||
|
BuildRequires: gcc12
|
||||||
|
BuildRequires: gcc12-c++
|
||||||
|
%else
|
||||||
|
BuildRequires: gcc
|
||||||
|
BuildRequires: gcc-c++
|
||||||
|
%endif
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
%if %{with docs}
|
%if %{with docs}
|
||||||
@ -65,6 +71,10 @@ This package contains header files required for C modules development.
|
|||||||
sed -i '1{/env python/d}' src/greenlet/tests/test_version.py
|
sed -i '1{/env python/d}' src/greenlet/tests/test_version.py
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
%if 0%{?suse_version} < 1600
|
||||||
|
export CC=gcc-12
|
||||||
|
export CXX=g++-12
|
||||||
|
%endif
|
||||||
export CFLAGS="%{optflags} -fno-tree-dominator-opts -fno-strict-aliasing"
|
export CFLAGS="%{optflags} -fno-tree-dominator-opts -fno-strict-aliasing"
|
||||||
%pyproject_wheel
|
%pyproject_wheel
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user