# HG changeset patch # User Daniele Nicolodi # Date 1322644687 -3600 # Node ID 4b5f83e5a2fb7c70755fa888fca114095966cb66 # Parent a198738e3187177388d694b94b3e7f2b1e761b05 Fix setup.py for the case where executing 'hg' fails. diff -r a198738e3187 -r 4b5f83e5a2fb setup.py --- a/setup.py Wed Nov 30 09:54:23 2011 +0100 +++ b/setup.py Wed Nov 30 10:18:07 2011 +0100 @@ -26,12 +26,15 @@ if version.endswith('dev') and os.path.isdir('.hg'): # add hg revision id to version string - p = subprocess.Popen(['hg', 'id', '--id'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE) - out, err = p.communicate() - if not p.returncode: - rev = out.strip().replace('+', '') - version += '-' + rev + try: + p = subprocess.Popen(['hg', 'id', '--id'], + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + out, err = p.communicate() + if not p.returncode: + rev = out.strip().replace('+', '') + version += '-' + rev + except OSError: + pass setup(name='ltpdarepo',