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
Boxiang Sun
cython
Commits
db7d8c7c
Commit
db7d8c7c
authored
Aug 27, 2012
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some PyPy glitches in __Pyx_Globals()
parent
66aa9874
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
Cython/Utility/Builtins.c
Cython/Utility/Builtins.c
+19
-3
No files found.
Cython/Utility/Builtins.c
View file @
db7d8c7c
...
...
@@ -13,7 +13,7 @@ static PyObject* __Pyx_Globals(void); /*proto*/
static
PyObject
*
__Pyx_Globals
(
void
)
{
Py_ssize_t
i
;
/
*PyObject *d;*/
/
/PyObject *d;
PyObject
*
names
=
NULL
;
PyObject
*
globals
=
PyObject_GetAttrString
(
$
module_cname
,
"__dict__"
);
if
(
!
globals
)
{
...
...
@@ -24,17 +24,33 @@ static PyObject* __Pyx_Globals(void) {
names
=
PyObject_Dir
(
$
module_cname
);
if
(
!
names
)
goto
bad
;
for
(
i
=
0
;
i
<
PyList_GET_SIZE
(
names
);
i
++
)
{
for
(
i
=
PyList_GET_SIZE
(
names
)
-
1
;
i
>=
0
;
i
--
)
{
#if CYTHON_COMPILING_IN_PYPY
PyObject
*
name
=
PySequence_GetItem
(
names
,
i
);
if
(
!
name
)
goto
bad
;
#else
PyObject
*
name
=
PyList_GET_ITEM
(
names
,
i
);
#endif
if
(
!
PyDict_Contains
(
globals
,
name
))
{
PyObject
*
value
=
PyObject_GetAttr
(
$
module_cname
,
name
);
if
(
!
value
)
if
(
!
value
)
{
#if CYTHON_COMPILING_IN_PYPY
Py_DECREF
(
name
);
#endif
goto
bad
;
}
if
(
PyDict_SetItem
(
globals
,
name
,
value
)
<
0
)
{
#if CYTHON_COMPILING_IN_PYPY
Py_DECREF
(
name
);
#endif
Py_DECREF
(
value
);
goto
bad
;
}
}
#if CYTHON_COMPILING_IN_PYPY
Py_DECREF
(
name
);
#endif
}
Py_DECREF
(
names
);
return
globals
;
...
...
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