Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kestrel Collaboration
Kestrel LiteX
migen
Commits
31c446ba
Commit
31c446ba
authored
6 years ago
by
Sebastien Bourdeauducq
Browse files
Options
Download
Email Patches
Plain Diff
build/tools: fix process/fd resource management when coloring
parent
8d68a3df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
migen/build/tools.py
migen/build/tools.py
+7
-7
No files found.
migen/build/tools.py
View file @
31c446ba
...
@@ -48,10 +48,10 @@ def sub_rules(line, rules, max_matches=1):
...
@@ -48,10 +48,10 @@ def sub_rules(line, rules, max_matches=1):
def
subprocess_call_filtered
(
command
,
rules
,
*
,
max_matches
=
1
,
**
kwargs
):
def
subprocess_call_filtered
(
command
,
rules
,
*
,
max_matches
=
1
,
**
kwargs
):
proc
=
subprocess
.
Popen
(
command
,
stdout
=
subprocess
.
PIPE
,
with
subprocess
.
Popen
(
command
,
stdout
=
subprocess
.
PIPE
,
universal_newlines
=
True
,
bufsize
=
1
,
universal_newlines
=
True
,
bufsize
=
1
,
**
kwargs
)
**
kwargs
)
as
proc
:
with
proc
:
with
open
(
proc
.
stdout
.
fileno
(),
errors
=
"ignore"
,
closefd
=
False
)
as
stdout
:
for
line
in
open
(
proc
.
stdout
.
fileno
(),
errors
=
"ignore"
)
:
for
line
in
stdout
:
print
(
sub_rules
(
line
,
rules
,
max_matches
),
end
=
""
)
print
(
sub_rules
(
line
,
rules
,
max_matches
),
end
=
""
)
return
proc
.
returncode
return
proc
.
wait
()
This diff is collapsed.
Click to expand it.
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