Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setupinfo.py: check the return value #336

Merged
merged 1 commit into from Jan 20, 2022
Merged

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
2 participants