Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
setupinfo.py: check the return value of subprocesses (GH-336)
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'
- Loading branch information