diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2015-03-21 20:33:51 +0100 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2015-03-21 20:33:51 +0100 |
commit | 42bbfdca8956d607c7bfceed1cc55b9bca48faf8 (patch) | |
tree | d694475375f1175feae16939ddcc13e9bdf7eed0 /setupinfo.py | |
parent | 57da35d90344a07833f7bc5cb80a1b2af22190c1 (diff) | |
download | python-lxml-42bbfdca8956d607c7bfceed1cc55b9bca48faf8.tar.gz |
fix libxml2 check on build failures and enable it also when Cython isn't available
Diffstat (limited to 'setupinfo.py')
-rw-r--r-- | setupinfo.py | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/setupinfo.py b/setupinfo.py index 8b6385fe..e04c38f8 100644 --- a/setupinfo.py +++ b/setupinfo.py @@ -197,21 +197,17 @@ def find_dependencies(module): def extra_setup_args(): - result = {} - if CYTHON_INSTALLED: - class CheckLibxml2BuildExt(_build_ext): - """Subclass to check whether libxml2 is really available if the build fails""" - - def run(self): - try: - super(CheckLibxml2BuildExt, self).run(self) - except CompileError as e: - print('Compile failed: %s' % e) - if not seems_to_have_libxml2(): - print_libxml_error() - raise - - result['cmdclass'] = {'build_ext': CheckLibxml2BuildExt} + class CheckLibxml2BuildExt(_build_ext): + """Subclass to check whether libxml2 is really available if the build fails""" + def run(self): + try: + _build_ext.run(self) # old-style class in Py2 + except CompileError as e: + print('Compile failed: %s' % e) + if not seems_to_have_libxml2(): + print_libxml_error() + raise + result = {'cmdclass': {'build_ext': CheckLibxml2BuildExt}} return result |