diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-10-16 07:42:45 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-10-16 07:42:45 (GMT) |
commit | eb063011ab6628d45cffab2f41947866b0d00e8d (patch) | |
tree | e97c81665772cd7ce8af965cb741fea86423d048 /Doc/tutorial | |
parent | f46d3afc51d0081ad1515a52d12b96fa26d1edd4 (diff) | |
download | cpython-eb063011ab6628d45cffab2f41947866b0d00e8d.zip cpython-eb063011ab6628d45cffab2f41947866b0d00e8d.tar.gz cpython-eb063011ab6628d45cffab2f41947866b0d00e8d.tar.bz2 |
Issue #22636: Avoid using a shell in the ctypes.util module
Replace os.popen() with subprocess.Popen.
If the "gcc", "cc" or "objdump" command is not available, the code was
supposed to raise an OSError exception. But there was a bug in the code. The
shell code returns the exit code 10 if the required command is missing, and the
code tries to check for the status 10. The problem is that os.popen() doesn't
return the exit code directly, but a status which should be processed by
os.WIFEXITED() and os.WEXITSTATUS(). In practice, the exception was never
raised. The OSError exception was not documented and ctypes.util.find_library()
is expected to return None if the library is not found.
Based on patch by Victor Stinner.
Diffstat (limited to 'Doc/tutorial')
0 files changed, 0 insertions, 0 deletions