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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
96d76b4c
Commit
96d76b4c
authored
Mar 16, 2018
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix accidental usage of PyFrozenSet_New() in PyPy.
parent
160ca319
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
2 deletions
+17
-2
CHANGES.rst
CHANGES.rst
+13
-0
Cython/Utility/ObjectHandling.c
Cython/Utility/ObjectHandling.c
+2
-1
Cython/Utility/Optimize.c
Cython/Utility/Optimize.c
+2
-1
No files found.
CHANGES.rst
View file @
96d76b4c
...
...
@@ -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)
=================
...
...
Cython/Utility/ObjectHandling.c
View file @
96d76b4c
...
...
@@ -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
);
...
...
Cython/Utility/Optimize.c
View file @
96d76b4c
...
...
@@ -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
);
...
...
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