comparison setup.py @ 232:4b5f83e5a2fb

Fix setup.py for the case where executing 'hg' fails.
author Daniele Nicolodi <daniele@grinta.net>
date Wed, 30 Nov 2011 10:18:07 +0100
parents 5c5f6d93d9d4
children 48adc0d70d22
comparison
equal deleted inserted replaced
231:a198738e3187 232:4b5f83e5a2fb
24 requires.append('ordereddict') 24 requires.append('ordereddict')
25 25
26 26
27 if version.endswith('dev') and os.path.isdir('.hg'): 27 if version.endswith('dev') and os.path.isdir('.hg'):
28 # add hg revision id to version string 28 # add hg revision id to version string
29 p = subprocess.Popen(['hg', 'id', '--id'], 29 try:
30 stdout=subprocess.PIPE, stderr=subprocess.PIPE) 30 p = subprocess.Popen(['hg', 'id', '--id'],
31 out, err = p.communicate() 31 stdout=subprocess.PIPE, stderr=subprocess.PIPE)
32 if not p.returncode: 32 out, err = p.communicate()
33 rev = out.strip().replace('+', '') 33 if not p.returncode:
34 version += '-' + rev 34 rev = out.strip().replace('+', '')
35 version += '-' + rev
36 except OSError:
37 pass
35 38
36 39
37 setup(name='ltpdarepo', 40 setup(name='ltpdarepo',
38 version=version, 41 version=version,
39 keywords='', 42 keywords='',