Skip to content
/ lxml Public

setupinfo.py: check the return value#336

Merged
scoder merged 1 commit intolxml:masterfrom
Mingli-Yu:master
Jan 20, 2022
Merged

setupinfo.py: check the return value#336
scoder merged 1 commit intolxml:masterfrom
Mingli-Yu:master

Conversation

@Mingli-Yu
Copy link
Contributor

@Mingli-Yu Mingli-Yu commented Jan 20, 2022

Use the return value altogether to check the subprocess execute
successfully or not as in some case it will print some noise
message though run successfully as below.

 # python
 Python 3.8.10 (default, Nov 26 2021, 20:14:08)
 [GCC 9.3.0] on linux
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import subprocess
 >>> cmd = "pkg-config --modversion libxml-2.0"
 >>> p = subprocess.Popen(cmd, shell=True,stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 >>> stdout_data, errors = p.communicate()
 >>> print(stdout_data)
 b'2.9.12\n'
 >>> print(errors)
 b'do_ypcall: clnt_call: RPC: Unable to send; errno = Network is unreachable\n'
 >>>

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>

Use the return value altogether to check the subprocess execute
successfully or not as in some case it will print some noise
message though run successfully as below.

 # python
 Python 3.8.10 (default, Nov 26 2021, 20:14:08)
 [GCC 9.3.0] on linux
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import subprocess
 >>> cmd = "pkg-config --modversion libxml-2.0"
 >>> p = subprocess.Popen(cmd, shell=True,stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 >>> stdout_data, errors = p.communicate()
 >>> print(stdout_data)
 b'2.9.12\n'
 >>> print(errors)
 b'do_ypcall: clnt_call: RPC: Unable to send; errno = Network is unreachable\n'
 >>>

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
@scoder
Copy link
Member

scoder commented Jan 20, 2022

Right, that seems more helpful. Thanks.

@scoder scoder merged commit 55f2815 into lxml:master Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants