1 |
On 8/2/19 10:49 AM, Zac Medico wrote: |
2 |
> On 8/2/19 9:06 AM, Mike Gilbert wrote: |
3 |
>> Bug: https://bugs.gentoo.org/691290 |
4 |
>> Signed-off-by: Mike Gilbert <floppym@g.o> |
5 |
>> --- |
6 |
>> lib/portage/process.py | 4 +++- |
7 |
>> 1 file changed, 3 insertions(+), 1 deletion(-) |
8 |
>> |
9 |
>> diff --git a/lib/portage/process.py b/lib/portage/process.py |
10 |
>> index 77f7fac02..4d5a42a8c 100644 |
11 |
>> --- a/lib/portage/process.py |
12 |
>> +++ b/lib/portage/process.py |
13 |
>> @@ -478,7 +478,9 @@ def _configure_loopback_interface(): |
14 |
>> |
15 |
>> try: |
16 |
>> subprocess.call(['ip', 'address', 'add', '10.0.0.1/8', 'dev', 'lo']) |
17 |
>> - subprocess.call(['ip', 'address', 'add', 'fd00::1/8', 'dev', 'lo']) |
18 |
>> + with open('/dev/null', 'wb') as devnull: |
19 |
>> + subprocess.call(['ip', 'address', 'add', 'fd00::1/8', 'dev', 'lo'], |
20 |
>> + stdout=devnull, stderr=devnull) |
21 |
>> except OSError as e: |
22 |
>> writemsg("Error calling 'ip': %s\n" % e.strerror, noiselevel=-1) |
23 |
>> |
24 |
>> |
25 |
> |
26 |
> Looks good, but let's use the os.devnull constant. Please merge. |
27 |
> |
28 |
|
29 |
Also, since buffering is pointless when the raw file descriptor is |
30 |
passed to a subprocess, it's best practice to use open(os.devnull, 'wb', 0). |
31 |
-- |
32 |
Thanks, |
33 |
Zac |