Commit 96d76b4c authored by Stefan Behnel's avatar Stefan Behnel

Fix accidental usage of PyFrozenSet_New() in PyPy.

parent 160ca319
......@@ -2,6 +2,19 @@
Cython Changelog
================
0.28.1 (2018-0?-??)
===================
Features added
--------------
Bugs fixed
----------
* ``PyFrozenSet_New()`` was accidentally used in PyPy where it is lacking
from the C-API.
0.28 (2018-03-13)
=================
......
......@@ -1049,6 +1049,7 @@ static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict,
static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq); /* proto */
/////////////// PySetContains ///////////////
//@requires: Builtins.c::pyfrozenset_new
static int __Pyx_PySet_ContainsUnhashable(PyObject *set, PyObject *key) {
int result = -1;
......@@ -1056,7 +1057,7 @@ static int __Pyx_PySet_ContainsUnhashable(PyObject *set, PyObject *key) {
/* Convert key to frozenset */
PyObject *tmpkey;
PyErr_Clear();
tmpkey = PyFrozenSet_New(key);
tmpkey = __Pyx_PyFrozenSet_New(key);
if (tmpkey != NULL) {
result = PySet_Contains(set, tmpkey);
Py_DECREF(tmpkey);
......
......@@ -486,6 +486,7 @@ static CYTHON_INLINE int __Pyx_set_iter_next(
}
/////////////// py_set_discard_unhashable ///////////////
//@requires: Builtins.c::pyfrozenset_new
static int __Pyx_PySet_DiscardUnhashable(PyObject *set, PyObject *key) {
PyObject *tmpkey;
......@@ -494,7 +495,7 @@ static int __Pyx_PySet_DiscardUnhashable(PyObject *set, PyObject *key) {
if (likely(!PySet_Check(key) || !PyErr_ExceptionMatches(PyExc_TypeError)))
return -1;
PyErr_Clear();
tmpkey = PyFrozenSet_New(key);
tmpkey = __Pyx_PyFrozenSet_New(key);
if (tmpkey == NULL)
return -1;
rv = PySet_Discard(set, tmpkey);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment