Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
0063958c
Commit
0063958c
authored
Aug 02, 2010
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minimum fixes to make freeze.py do something useful.
parent
bf76ce16
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
Tools/freeze/freeze.py
Tools/freeze/freeze.py
+1
-1
Tools/freeze/makeconfig.py
Tools/freeze/makeconfig.py
+6
-7
No files found.
Tools/freeze/freeze.py
View file @
0063958c
...
...
@@ -201,7 +201,7 @@ def main():
# modules that are imported by the Python runtime
implicits
=
[]
for
module
in
(
'site'
,
'warnings'
,):
for
module
in
(
'site'
,
'warnings'
,
'encodings.utf_8'
,
'encodings.latin_1'
):
if
module
not
in
exclude
:
implicits
.
append
(
module
)
...
...
Tools/freeze/makeconfig.py
View file @
0063958c
...
...
@@ -3,14 +3,13 @@ import re
# Write the config.c file
never
=
[
'marshal'
,
'__main__'
,
'builtins'
,
'sys'
,
'exceptions'
,
'_warnings'
]
never
=
[
'marshal'
,
'imp'
,
'_ast'
,
'__main__'
,
'builtins'
,
'sys'
,
'gc'
,
'_warnings'
]
def
makeconfig
(
infp
,
outfp
,
modules
,
with_ifdef
=
0
):
m1
=
re
.
compile
(
'-- ADDMODULE MARKER 1 --'
)
m2
=
re
.
compile
(
'-- ADDMODULE MARKER 2 --'
)
while
1
:
line
=
infp
.
readline
()
if
not
line
:
break
for
line
in
infp
:
outfp
.
write
(
line
)
if
m1
and
m1
.
search
(
line
):
m1
=
None
...
...
@@ -18,8 +17,8 @@ def makeconfig(infp, outfp, modules, with_ifdef=0):
if
mod
in
never
:
continue
if
with_ifdef
:
outfp
.
write
(
"#ifndef
init
%s
\
n
"
%
mod
)
outfp
.
write
(
'extern
void init
%s(void);
\
n
'
%
mod
)
outfp
.
write
(
"#ifndef
PyInit_
%s
\
n
"
%
mod
)
outfp
.
write
(
'extern
PyObject* PyInit_
%s(void);
\
n
'
%
mod
)
if
with_ifdef
:
outfp
.
write
(
"#endif
\
n
"
)
elif
m2
and
m2
.
search
(
line
):
...
...
@@ -27,7 +26,7 @@ def makeconfig(infp, outfp, modules, with_ifdef=0):
for
mod
in
modules
:
if
mod
in
never
:
continue
outfp
.
write
(
'
\
t
{"%s",
init
%s},
\
n
'
%
outfp
.
write
(
'
\
t
{"%s",
PyInit_
%s},
\
n
'
%
(
mod
,
mod
))
if
m1
:
sys
.
stderr
.
write
(
'MARKER 1 never found
\
n
'
)
...
...
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