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
d8f054f3
Commit
d8f054f3
authored
Sep 10, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup of __Pyx_ImportType() to allow constifying the imported class name string
parent
0708b991
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+9
-10
No files found.
Cython/Compiler/ModuleNode.py
View file @
d8f054f3
...
@@ -1987,29 +1987,29 @@ bad:
...
@@ -1987,29 +1987,29 @@ bad:
type_import_utility_code
=
[
type_import_utility_code
=
[
"""
"""
static PyTypeObject *__Pyx_ImportType(const char *module_name, char *class_name, long size); /*proto*/
static PyTypeObject *__Pyx_ImportType(const char *module_name, c
onst c
har *class_name, long size); /*proto*/
"""
,
"""
"""
,
"""
#ifndef __PYX_HAVE_RT_ImportType
#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, char *class_name,
static PyTypeObject *__Pyx_ImportType(const char *module_name, c
onst c
har *class_name,
long size)
long size)
{
{
PyObject *py_module = 0;
PyObject *py_module = 0;
PyObject *result = 0;
PyObject *result = 0;
PyObject *py_name = 0;
PyObject *py_name = 0;
py_module = __Pyx_ImportModule(module_name);
if (!py_module)
goto bad;
#if PY_MAJOR_VERSION < 3
#if PY_MAJOR_VERSION < 3
py_name = PyString_FromString(
module
_name);
py_name = PyString_FromString(
class
_name);
#else
#else
py_name = PyUnicode_FromString(
module
_name);
py_name = PyUnicode_FromString(
class
_name);
#endif
#endif
if (!py_name)
if (!py_name)
goto bad;
goto bad;
result = PyObject_GetAttr(py_module, py_name);
py_module = __Pyx_ImportModule(module_name);
Py_DECREF(py_name);
if (!py_module)
goto bad;
result = PyObject_GetAttrString(py_module, class_name);
if (!result)
if (!result)
goto bad;
goto bad;
if (!PyType_Check(result)) {
if (!PyType_Check(result)) {
...
@@ -2026,7 +2026,6 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, char *class_name,
...
@@ -2026,7 +2026,6 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, char *class_name,
}
}
return (PyTypeObject *)result;
return (PyTypeObject *)result;
bad:
bad:
Py_XDECREF(py_name);
Py_XDECREF(result);
Py_XDECREF(result);
return 0;
return 0;
}
}
...
...
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