[pkg] Make sure the gecode extension build never ever fails (closes #158948)

In some cases (eg, windows without Visual Studio installed), distutils/setuptools build_ext.run() may raise exceptions other than CompileError. By catching all exceptions, we can make sure rql's setup.py never fails, which should help dumb package managers such as pip.

authorRémi Cardona <remi.cardona@logilab.fr>
changeset679566d1203d
branchstable
phasepublic
hiddenno
parent revision#3e6b5f8cc4d2 fix add_type_restriction() implementation with IN() function (closes #138635)
child revision#395b8ad2228c prepare 0.31.4
files modified by this revision
setup.py
# HG changeset patch
# User Rémi Cardona <remi.cardona@logilab.fr>
# Date 1375453854 -7200
# Fri Aug 02 16:30:54 2013 +0200
# Branch stable
# Node ID 679566d1203d791062330f7eb98ddd7ce39cd7b7
# Parent 3e6b5f8cc4d22d3f6154101b66e89ccefcd09c30
[pkg] Make sure the gecode extension build never ever fails (closes #158948)

In some cases (eg, windows without Visual Studio installed),
distutils/setuptools build_ext.run() may raise exceptions other than
CompileError. By catching all exceptions, we can make sure rql's
setup.py never fails, which should help dumb package managers such as
pip.

diff --git a/setup.py b/setup.py
@@ -164,14 +164,13 @@
1  class MyBuildExt(build_ext.build_ext):
2      """Extend build_ext command to pass through compilation error.
3      In fact, if gecode extension fail, rql will use logilab.constraint
4      """
5      def run(self):
6 -        from distutils.errors import CompileError
7          try:
8              build_ext.build_ext.run(self)
9 -        except CompileError:
10 +        except Exception:
11              import traceback
12              traceback.print_exc()
13              sys.stderr.write('================================\n'
14                               'The compilation of the gecode C extension failed. '
15                               'rql will use logilab.constraint which is a pure '