diff options
author | Alexander Bokovoy <abokovoy@redhat.com> | 2011-11-16 15:10:21 +0200 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2011-11-16 18:34:16 -0500 |
commit | ebdc752b66fac4f0b1187fd5460f7e67463085ce (patch) | |
tree | 098d50337f9b0c8d0fe99d60b1aa2f4a2d62fd2d /ipapython | |
parent | 151001ac48cfd18e91104a9ddc8d2efcabcc5eeb (diff) | |
download | freeipa-ebdc752b66fac4f0b1187fd5460f7e67463085ce.tar.gz freeipa-ebdc752b66fac4f0b1187fd5460f7e67463085ce.tar.xz freeipa-ebdc752b66fac4f0b1187fd5460f7e67463085ce.zip |
Check for Python.h during build of py_default_encoding extension
For rare cases when Python development package is not installed,
check that Python.h is available and bail out if not.
Fixes:
https://fedorahosted.org/freeipa/ticket/1838
Diffstat (limited to 'ipapython')
-rw-r--r-- | ipapython/py_default_encoding/setup.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ipapython/py_default_encoding/setup.py b/ipapython/py_default_encoding/setup.py index 87f7504e4..de2478c19 100644 --- a/ipapython/py_default_encoding/setup.py +++ b/ipapython/py_default_encoding/setup.py @@ -18,6 +18,13 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. from distutils.core import setup, Extension +from distutils.sysconfig import get_python_inc +import sys +import os + +python_header = os.path.join(get_python_inc(plat_specific=1), 'Python.h') +if not os.path.exists(python_header): + sys.exit("Cannot find Python development packages that provide Python.h") default_encoding_utf8 = Extension('default_encoding_utf8', ['default_encoding_utf8.c']) |