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
c4c463b5
Commit
c4c463b5
authored
Dec 19, 2012
by
scoder
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #171 from bfroehle/py_limited_api
Fix __Pyx_ImportType if #Py_LIMITED_API is defined.
parents
07cea6d9
2b53cee8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
Cython/Utility/ImportExport.c
Cython/Utility/ImportExport.c
+15
-2
No files found.
Cython/Utility/ImportExport.c
View file @
c4c463b5
...
...
@@ -141,6 +141,8 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
PyObject
*
result
=
0
;
PyObject
*
py_name
=
0
;
char
warning
[
200
];
PyObject
*
py_basicsize
;
Py_ssize_t
basicsize
;
py_module
=
__Pyx_ImportModule
(
module_name
);
if
(
!
py_module
)
...
...
@@ -161,7 +163,18 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
module_name
,
class_name
);
goto
bad
;
}
if
(
!
strict
&&
(
size_t
)((
PyTypeObject
*
)
result
)
->
tp_basicsize
>
size
)
{
#ifndef Py_LIMITED_API
basicsize
=
((
PyTypeObject
*
)
result
)
->
tp_basicsize
;
#else
py_basicsize
=
PyObject_GetAttrString
(
result
,
"__basicsize__"
);
if
(
!
py_basicsize
)
goto
bad
;
basicsize
=
PyLong_AsSsize_t
(
py_basicsize
);
Py_DECREF
(
py_basicsize
);
if
(
basicsize
==
(
Py_ssize_t
)
-
1
&&
PyErr_Occurred
())
goto
bad
;
#endif
if
(
!
strict
&&
(
size_t
)
basicsize
>
size
)
{
PyOS_snprintf
(
warning
,
sizeof
(
warning
),
"%s.%s size changed, may indicate binary incompatibility"
,
module_name
,
class_name
);
...
...
@@ -171,7 +184,7 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
if
(
PyErr_WarnEx
(
NULL
,
warning
,
0
)
<
0
)
goto
bad
;
#endif
}
else
if
((
size_t
)
((
PyTypeObject
*
)
result
)
->
tp_
basicsize
!=
size
)
{
else
if
((
size_t
)
basicsize
!=
size
)
{
PyErr_Format
(
PyExc_ValueError
,
"%s.%s has the wrong size, try recompiling"
,
module_name
,
class_name
);
...
...
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