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
abba2535
Commit
abba2535
authored
Oct 06, 2009
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
cb43e5e3
8c686843
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+7
-5
bin/cython_freeze.py
bin/cython_freeze.py
+2
-0
No files found.
Cython/Compiler/ModuleNode.py
View file @
abba2535
...
...
@@ -264,7 +264,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
=
globalstate
[
'before_global_var'
]
code
.
putln
(
'#define __Pyx_MODULE_NAME "%s"'
%
self
.
full_module_name
)
code
.
putln
(
"int %s%s =
%s;"
%
(
Naming
.
module_is_main
,
self
.
full_module_name
.
replace
(
'.'
,
'__'
),
int
(
Options
.
embed
)))
code
.
putln
(
"int %s%s =
0;"
%
(
Naming
.
module_is_main
,
self
.
full_module_name
.
replace
(
'.'
,
'__'
)))
code
.
putln
(
""
)
code
.
putln
(
"/* Implementation of %s */"
%
env
.
qualified_name
)
...
...
@@ -1782,7 +1782,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
'}'
)
def
generate_main_method
(
self
,
env
,
code
):
code
.
globalstate
.
use_utility_code
(
main_method
.
specialize
(
module_name
=
env
.
module_name
))
module_is_main
=
"%s%s"
%
(
Naming
.
module_is_main
,
self
.
full_module_name
.
replace
(
'.'
,
'__'
))
code
.
globalstate
.
use_utility_code
(
main_method
.
specialize
(
module_name
=
env
.
module_name
,
module_is_main
=
module_is_main
))
def
generate_filename_init_call
(
self
,
code
):
code
.
putln
(
"%s();"
%
Naming
.
fileinit_cname
)
...
...
@@ -2459,7 +2460,7 @@ static __Pyx_RefnannyAPIStruct *__Pyx_Refnanny = NULL;
#define __Pyx_DECREF(r) __Pyx_Refnanny->DECREF(__pyx_refchk, (PyObject *)(r), __LINE__)
#define __Pyx_GOTREF(r) __Pyx_Refnanny->GOTREF(__pyx_refchk, (PyObject *)(r), __LINE__)
#define __Pyx_GIVEREF(r) __Pyx_Refnanny->GIVEREF(__pyx_refchk, (PyObject *)(r), __LINE__)
#define __Pyx_XDECREF(r)
if((r) == NULL) ; else __Pyx_DECREF(r
)
#define __Pyx_XDECREF(r)
do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0
)
#define __Pyx_SetupRefcountContext(name)
\
void* __pyx_refchk = __Pyx_Refnanny->NewContext((name), __LINE__, __FILE__)
#define __Pyx_FinishRefcountContext()
\
...
...
@@ -2473,8 +2474,8 @@ static __Pyx_RefnannyAPIStruct *__Pyx_Refnanny = NULL;
#define __Pyx_SetupRefcountContext(name)
#define __Pyx_FinishRefcountContext()
#endif /* CYTHON_REFNANNY */
#define __Pyx_XGIVEREF(r)
if((r) == NULL) ; else __Pyx_GIVEREF(r
)
#define __Pyx_XGOTREF(r)
if((r) == NULL) ; else __Pyx_GOTREF(r
)
#define __Pyx_XGIVEREF(r)
do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0
)
#define __Pyx_XGOTREF(r)
do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0
)
"""
)
...
...
@@ -2490,6 +2491,7 @@ int wmain(int argc, wchar_t **argv) {
Py_SetProgramName(argv[0]);
Py_Initialize();
PySys_SetArgv(argc, argv);
%(module_is_main)s = 1;
#if PY_MAJOR_VERSION < 3
init%(module_name)s();
#else
...
...
bin/cython_freeze.py
100644 → 100755
View file @
abba2535
...
...
@@ -15,6 +15,8 @@ if len(sys.argv) < 2:
def
format_modname
(
name
):
if
name
.
endswith
(
'.pyx'
):
name
=
name
[:
-
4
]
elif
name
.
endswith
(
'.py'
):
name
=
name
[:
-
3
]
return
name
.
replace
(
'.'
,
'_'
)
modules
=
[
format_modname
(
x
)
for
x
in
sys
.
argv
[
1
:]]
...
...
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