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
Gwenaël Samain
cython
Commits
e6104531
Commit
e6104531
authored
Sep 18, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
work around PyPy's lack of PyFrozenSet_*() C-API
parent
796d16b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
Cython/Utility/Builtins.c
Cython/Utility/Builtins.c
+14
-3
No files found.
Cython/Utility/Builtins.c
View file @
e6104531
...
@@ -366,6 +366,16 @@ static CYTHON_INLINE PyObject* __Pyx_PyDict_ViewItems(PyObject* d) {
...
@@ -366,6 +366,16 @@ static CYTHON_INLINE PyObject* __Pyx_PyDict_ViewItems(PyObject* d) {
static
CYTHON_INLINE
PyObject
*
__Pyx_PyFrozenSet_New
(
PyObject
*
it
)
{
static
CYTHON_INLINE
PyObject
*
__Pyx_PyFrozenSet_New
(
PyObject
*
it
)
{
if
(
it
)
{
if
(
it
)
{
PyObject
*
result
;
PyObject
*
result
;
#if CYTHON_COMPILING_IN_PYPY
// PyPy currently lacks PyFrozenSet_CheckExact() and PyFrozenSet_New()
PyObject
*
args
;
args
=
PyTuple_Pack
(
1
,
it
);
if
(
unlikely
(
!
args
))
return
NULL
;
result
=
PyObject_Call
((
PyObject
*
)
&
PyFrozenSet_Type
,
args
,
NULL
);
Py_DECREF
(
args
);
return
result
;
#else
if
(
PyFrozenSet_CheckExact
(
it
))
{
if
(
PyFrozenSet_CheckExact
(
it
))
{
Py_INCREF
(
it
);
Py_INCREF
(
it
);
return
it
;
return
it
;
...
@@ -378,10 +388,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) {
...
@@ -378,10 +388,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) {
// empty frozenset is a singleton
// empty frozenset is a singleton
// seems wasteful, but CPython does the same
// seems wasteful, but CPython does the same
Py_DECREF
(
result
);
Py_DECREF
(
result
);
#endif
}
}
#if CYTHON_COMPILING_IN_CPYTHON
#if CYTHON_COMPILING_IN_CPYTHON
return
PyFrozenSet_Type
.
tp_new
(
&
PyFrozenSet_Type
,
$
empty_tuple
,
NULL
);
return
PyFrozenSet_Type
.
tp_new
(
&
PyFrozenSet_Type
,
$
empty_tuple
,
NULL
);
#else
#else
return
PyObject_Call
((
PyObject
*
)
&
PyFrozenSet_Type
,
$
empty_tuple
,
NULL
);
return
PyObject_Call
((
PyObject
*
)
&
PyFrozenSet_Type
,
$
empty_tuple
,
NULL
);
#endif
#endif
}
}
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