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
bbdda5ce
Commit
bbdda5ce
authored
Mar 21, 2001
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch #409504: Fix regex problems, consider \-continuation lines in Makefile
and Setup.
parent
cfb59301
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
Tools/freeze/makeconfig.py
Tools/freeze/makeconfig.py
+2
-2
Tools/freeze/parsesetup.py
Tools/freeze/parsesetup.py
+13
-0
No files found.
Tools/freeze/makeconfig.py
View file @
bbdda5ce
...
...
@@ -12,7 +12,7 @@ def makeconfig(infp, outfp, modules, with_ifdef=0):
line
=
infp
.
readline
()
if
not
line
:
break
outfp
.
write
(
line
)
if
m1
and
m1
.
search
(
line
)
>=
0
:
if
m1
and
m1
.
search
(
line
):
m1
=
None
for
mod
in
modules
:
if
mod
in
never
:
...
...
@@ -22,7 +22,7 @@ def makeconfig(infp, outfp, modules, with_ifdef=0):
outfp
.
write
(
'extern void init%s();
\
n
'
%
mod
)
if
with_ifdef
:
outfp
.
write
(
"#endif
\
n
"
)
elif
m2
and
m2
.
search
(
line
)
>=
0
:
elif
m2
and
m2
.
search
(
line
):
m2
=
None
for
mod
in
modules
:
if
mod
in
never
:
...
...
Tools/freeze/parsesetup.py
View file @
bbdda5ce
...
...
@@ -13,11 +13,17 @@ makevardef = re.compile('^([a-zA-Z0-9_]+)[ \t]*=(.*)')
def
getmakevars
(
filename
):
variables
=
{}
fp
=
open
(
filename
)
pendingline
=
""
try
:
while
1
:
line
=
fp
.
readline
()
if
pendingline
:
line
=
pendingline
+
line
pendingline
=
""
if
not
line
:
break
if
line
.
endswith
(
'
\
\
\
n
'
):
pendingline
=
line
[:
-
2
]
matchobj
=
makevardef
.
match
(
line
)
if
not
matchobj
:
continue
...
...
@@ -44,15 +50,22 @@ def getsetupinfo(filename):
modules
=
{}
variables
=
{}
fp
=
open
(
filename
)
pendingline
=
""
try
:
while
1
:
line
=
fp
.
readline
()
if
pendingline
:
line
=
pendingline
+
line
pendingline
=
""
if
not
line
:
break
# Strip comments
i
=
string
.
find
(
line
,
'#'
)
if
i
>=
0
:
line
=
line
[:
i
]
if
line
.
endswith
(
'
\
\
\
n
'
):
pendingline
=
line
[:
-
2
]
continue
matchobj
=
setupvardef
.
match
(
line
)
if
matchobj
:
(
name
,
value
)
=
matchobj
.
group
(
1
,
2
)
...
...
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