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
feee1a22
Commit
feee1a22
authored
Dec 11, 2009
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Warning for extern type import size mismatch.
parent
ff35cf52
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+8
-7
No files found.
Cython/Compiler/ModuleNode.py
View file @
feee1a22
...
...
@@ -445,6 +445,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
" #define PyInt_AsSsize_t(o) PyInt_AsLong(o)"
)
code
.
putln
(
" #define PyNumber_Index(o) PyNumber_Int(o)"
)
code
.
putln
(
" #define PyIndex_Check(o) PyNumber_Check(o)"
)
code
.
putln
(
" #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)"
)
code
.
putln
(
"#endif"
)
code
.
putln
(
"#if PY_VERSION_HEX < 0x02060000"
)
...
...
@@ -2166,7 +2167,7 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
PyObject *py_module = 0;
PyObject *result = 0;
PyObject *py_name = 0;
int size_ok
;
char warning[200]
;
py_module = __Pyx_ImportModule(module_name);
if (!py_module)
...
...
@@ -2191,13 +2192,13 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
module_name, class_name);
goto bad;
}
if (
strict
) {
size_ok = ((PyTypeObject *)result)->tp_basicsize == size;
}
else {
size_ok = ((PyTypeObject *)result)->tp_basicsize >= size
;
if (
!strict && ((PyTypeObject *)result)->tp_basicsize > size
) {
PyOS_snprintf(warning, sizeof(warning),
"%s.%s size changed, may indicate binary incompatibility",
module_name, class_name);
PyErr_WarnEx(NULL, warning, 0)
;
}
if (!size_ok
) {
else if (((PyTypeObject *)result)->tp_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