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
ae6743bc
Commit
ae6743bc
authored
Jun 12, 2011
by
Lisandro Dalcin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PyErr_WarnEx() can become an error
parent
de0a73eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+7
-7
No files found.
Cython/Compiler/ModuleNode.py
View file @
ae6743bc
...
...
@@ -2419,13 +2419,13 @@ bad:
type_import_utility_code
=
UtilityCode
(
proto
=
"""
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
long
size, int strict); /*proto*/
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
size_t
size, int strict); /*proto*/
"""
,
impl
=
"""
#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
long
size, int strict)
size_t
size, int strict)
{
PyObject *py_module = 0;
PyObject *result = 0;
...
...
@@ -2455,17 +2455,17 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
module_name, class_name);
goto bad;
}
if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) {
if (!strict && ((PyTypeObject *)result)->tp_basicsize >
(Py_ssize_t)
size) {
PyOS_snprintf(warning, sizeof(warning),
"%s.%s size changed, may indicate binary incompatibility",
module_name, class_name);
#if PY_VERSION_HEX < 0x02050000
PyErr_Warn(NULL, warning)
;
if (PyErr_Warn(NULL, warning) < 0) goto bad
;
#else
PyErr_WarnEx(NULL, warning, 0)
;
if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad
;
#endif
}
else if (((PyTypeObject *)result)->tp_basicsize != size) {
else if (((PyTypeObject *)result)->tp_basicsize !=
(Py_ssize_t)
size) {
PyErr_Format(PyExc_ValueError,
"%s.%s has the wrong size, try recompiling",
module_name, class_name);
...
...
@@ -2475,7 +2475,7 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
bad:
Py_XDECREF(py_module);
Py_XDECREF(result);
return
0
;
return
NULL
;
}
#endif
"""
)
...
...
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