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
e5e30b97
Commit
e5e30b97
authored
Sep 18, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
work around PyPy not supporting PySet_Size() in frozenset objects
parent
e6104531
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+1
-1
Cython/Utility/ModuleSetupCode.c
Cython/Utility/ModuleSetupCode.c
+3
-0
No files found.
Cython/Compiler/Optimize.py
View file @
e5e30b97
...
...
@@ -2197,7 +2197,7 @@ class OptimizeBuiltinCalls(Visitor.NodeRefCleanupMixin,
Builtin
.
tuple_type
:
"PyTuple_GET_SIZE"
,
Builtin
.
dict_type
:
"PyDict_Size"
,
Builtin
.
set_type
:
"PySet_Size"
,
Builtin
.
frozenset_type
:
"
Py
Set_Size"
,
Builtin
.
frozenset_type
:
"
__Pyx_PyFrozen
Set_Size"
,
}.
get
_ext_types_with_pysize
=
set
([
"cpython.array.array"
])
...
...
Cython/Utility/ModuleSetupCode.c
View file @
e5e30b97
...
...
@@ -96,10 +96,13 @@
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
#define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
// PyPy doesn't handle frozenset() in PySet_Size()
#define __Pyx_PyFrozenSet_Size(s) PyObject_Size(s)
#else
#define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
#define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#define __Pyx_PyFrozenSet_Size(s) PySet_Size(s)
#endif
#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
...
...
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