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
40991b47
Commit
40991b47
authored
Mar 04, 2019
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '0.29.x'
parents
a1b85697
566fc5c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+8
-8
No files found.
Cython/Compiler/ModuleNode.py
View file @
40991b47
...
...
@@ -2725,11 +2725,11 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
# if entry.type.is_pyobject and entry.used:
# code.putln("Py_DECREF(%s); %s = 0;" % (
# code.entry_as_pyobject(entry), entry.cname))
code
.
putln
(
'#if CYTHON_COMPILING_IN_PYPY'
)
code
.
putln
(
'Py_CLEAR(%s);'
%
Naming
.
builtins_cname
)
code
.
putln
(
'#endif'
)
code
.
put_decref_clear
(
env
.
module_dict_cname
,
py_object_type
,
nanny
=
False
,
clear_before_decref
=
True
)
if
Options
.
pre_import
is
not
None
:
code
.
put_decref_clear
(
Naming
.
preimport_cname
,
py_object_type
,
nanny
=
False
,
clear_before_decref
=
True
)
for
cname
in
[
Naming
.
cython_runtime_cname
,
env
.
module_dict_cname
,
Naming
.
builtins_cname
]:
code
.
put_decref_clear
(
cname
,
py_object_type
,
nanny
=
False
,
clear_before_decref
=
True
)
def
generate_main_method
(
self
,
env
,
code
):
module_is_main
=
"%s%s"
%
(
Naming
.
module_is_main
,
self
.
full_module_name
.
replace
(
'.'
,
'__'
))
...
...
@@ -2836,13 +2836,12 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
'%s = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); %s'
%
(
Naming
.
builtins_cname
,
code
.
error_goto_if_null
(
Naming
.
builtins_cname
,
self
.
pos
)))
code
.
put_incref
(
Naming
.
builtins_cname
,
py_object_type
,
nanny
=
False
)
code
.
putln
(
'%s = PyImport_AddModule((char *) "cython_runtime"); %s'
%
(
Naming
.
cython_runtime_cname
,
code
.
error_goto_if_null
(
Naming
.
cython_runtime_cname
,
self
.
pos
)))
code
.
putln
(
'#if CYTHON_COMPILING_IN_PYPY'
)
code
.
putln
(
'Py_INCREF(%s);'
%
Naming
.
builtins_cname
)
code
.
putln
(
'#endif'
)
code
.
put_incref
(
Naming
.
cython_runtime_cname
,
py_object_type
,
nanny
=
False
)
code
.
putln
(
'if (PyObject_SetAttrString(%s, "__builtins__", %s) < 0) %s;'
%
(
env
.
module_cname
,
...
...
@@ -2854,6 +2853,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
Naming
.
preimport_cname
,
Options
.
pre_import
,
code
.
error_goto_if_null
(
Naming
.
preimport_cname
,
self
.
pos
)))
code
.
put_incref
(
Naming
.
preimport_cname
,
py_object_type
,
nanny
=
False
)
def
generate_global_init_code
(
self
,
env
,
code
):
# Generate code to initialise global PyObject *
...
...
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