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
Kirill Smelkov
cython
Commits
a5403b1b
Commit
a5403b1b
authored
Mar 09, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify Py3 checks in TypeConversion.c
parent
efd1e759
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
Cython/Utility/TypeConversion.c
Cython/Utility/TypeConversion.c
+7
-7
No files found.
Cython/Utility/TypeConversion.c
View file @
a5403b1b
...
...
@@ -10,7 +10,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t*
static
CYTHON_INLINE
PyObject
*
__Pyx_PyUnicode_FromString
(
char
*
);
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if PY_
VERSION_HEX < 0x03000000
#if PY_
MAJOR_VERSION < 3
#define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
...
...
@@ -55,7 +55,7 @@ static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_
VERSION_HEX < 0x03000000
&& __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
#if PY_
MAJOR_VERSION < 3
&& __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static
int
__Pyx_sys_getdefaultencoding_not_ascii
;
static
int
__Pyx_init_sys_getdefaultencoding_params
()
{
PyObject
*
sys
=
NULL
;
...
...
@@ -103,7 +103,7 @@ bad:
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#undef __PYX_DEFAULT_STRING_ENCODING
#if PY_
VERSION_HEX < 0x03000000
#if PY_
MAJOR_VERSION < 3
static
char
*
__PYX_DEFAULT_STRING_ENCODING
;
static
int
__Pyx_init_sys_getdefaultencoding_params
()
{
PyObject
*
sys
=
NULL
;
...
...
@@ -146,7 +146,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
static
CYTHON_INLINE
char
*
__Pyx_PyObject_AsStringAndSize
(
PyObject
*
o
,
Py_ssize_t
*
length
)
{
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
if
(
#if PY_
VERSION_HEX < 0x03000000
&& __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
#if PY_
MAJOR_VERSION < 3
&& __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
__Pyx_sys_getdefaultencoding_not_ascii
&&
#endif
PyUnicode_Check
(
o
))
{
...
...
@@ -211,14 +211,14 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
PyNumberMethods
*
m
;
const
char
*
name
=
NULL
;
PyObject
*
res
=
NULL
;
#if PY_
VERSION_HEX < 0x03000000
#if PY_
MAJOR_VERSION < 3
if
(
PyInt_Check
(
x
)
||
PyLong_Check
(
x
))
#else
if
(
PyLong_Check
(
x
))
#endif
return
Py_INCREF
(
x
),
x
;
m
=
Py_TYPE
(
x
)
->
tp_as_number
;
#if PY_
VERSION_HEX < 0x03000000
#if PY_
MAJOR_VERSION < 3
if
(
m
&&
m
->
nb_int
)
{
name
=
"int"
;
res
=
PyNumber_Int
(
x
);
...
...
@@ -234,7 +234,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
}
#endif
if
(
res
)
{
#if PY_
VERSION_HEX < 0x03000000
#if PY_
MAJOR_VERSION < 3
if
(
!
PyInt_Check
(
res
)
&&
!
PyLong_Check
(
res
))
{
#else
if
(
!
PyLong_Check
(
res
))
{
...
...
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