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
9a20302f
Commit
9a20302f
authored
Apr 11, 2015
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid using PyByteArray_*() C-API in pypy unless it defines it
parent
6d9596b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
Cython/Utility/Builtins.c
Cython/Utility/Builtins.c
+2
-0
Cython/Utility/TypeConversion.c
Cython/Utility/TypeConversion.c
+1
-1
No files found.
Cython/Utility/Builtins.c
View file @
9a20302f
...
...
@@ -269,11 +269,13 @@ static long __Pyx__PyObject_Ord(PyObject* c) {
}
else
if
(
PyUnicode_Check
(
c
))
{
return
(
long
)
__Pyx_PyUnicode_AsPy_UCS4
(
c
);
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
}
else
if
(
PyByteArray_Check
(
c
))
{
size
=
PyByteArray_GET_SIZE
(
c
);
if
(
likely
(
size
==
1
))
{
return
(
unsigned
char
)
PyByteArray_AS_STRING
(
c
)[
0
];
}
#endif
}
else
{
// FIXME: support character buffers - but CPython doesn't support them either
PyErr_Format
(
PyExc_TypeError
,
...
...
Cython/Utility/TypeConversion.c
View file @
9a20302f
...
...
@@ -226,7 +226,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_
}
else
#endif
/* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
#if
!CYTHON_COMPILING_IN_PYPY
#if
(!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
if
(
PyByteArray_Check
(
o
))
{
*
length
=
PyByteArray_GET_SIZE
(
o
);
return
PyByteArray_AS_STRING
(
o
);
...
...
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