[pkg] don't crash if g++ is not in $PATH

Closes #298337

authorJulien Cristau <julien.cristau@logilab.fr>
changeset336a9117fa1e
branchdefault
phasepublic
hiddenno
parent revision#74252f795c5d Added tag debian/0.33.1-2 for changeset d5be0ab6712c
child revision#c629ea9f78f6 [pkg] 0.33.2
files modified by this revision
__pkginfo__.py
# HG changeset patch
# User Julien Cristau <julien.cristau@logilab.fr>
# Date 1437557771 -7200
# Wed Jul 22 11:36:11 2015 +0200
# Node ID 336a9117fa1ef3544ddf17fb42ea9f630849ac30
# Parent 74252f795c5dfccc27cc4f4eec99c409ef2cb4eb
[pkg] don't crash if g++ is not in $PATH

Closes #298337

diff --git a/__pkginfo__.py b/__pkginfo__.py
@@ -47,11 +47,11 @@
1          try:
2              subprocess.check_call(['g++', '-o', 'gecode_version', 'data/gecode_version.cc'])
3              p = subprocess.Popen("./gecode_version", stdout=subprocess.PIPE)
4              vers = p.communicate()[0].decode('ascii')
5              version = [int(c) for c in vers.strip().split('.')]
6 -        except subprocess.CalledProcessError:
7 +        except (EnvironmentError, subprocess.CalledProcessError):
8              pass
9      return version
10 
11  def encode_version(a,b,c):
12      return ((a<<16)+(b<<8)+c)