Mercurial > hg
comparison setup.py @ 8627:4c5b46f736f1
setup: renamed l, e vars to out, err
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Tue, 26 May 2009 21:07:41 +0200 |
parents | cbd3a104637f |
children | 4dd06ab9217c |
comparison
equal
deleted
inserted
replaced
8626:1fc1c77d4863 | 8627:4c5b46f736f1 |
---|---|
106 purepath = os.path.join('mercurial', 'pure') | 106 purepath = os.path.join('mercurial', 'pure') |
107 os.environ['PYTHONPATH'] = os.pathsep.join(['mercurial', purepath, pypath]) | 107 os.environ['PYTHONPATH'] = os.pathsep.join(['mercurial', purepath, pypath]) |
108 os.environ['HGRCPATH'] = '' # do not read any config file | 108 os.environ['HGRCPATH'] = '' # do not read any config file |
109 cmd = [sys.executable, 'hg', 'id', '-i', '-t'] | 109 cmd = [sys.executable, 'hg', 'id', '-i', '-t'] |
110 | 110 |
111 l, e = subprocess.Popen(cmd, stdout=subprocess.PIPE, | 111 out, err = subprocess.Popen(cmd, stdout=subprocess.PIPE, |
112 stderr=subprocess.PIPE).communicate() | 112 stderr=subprocess.PIPE).communicate() |
113 os.environ['PYTHONPATH'] = pypath | 113 os.environ['PYTHONPATH'] = pypath |
114 | 114 |
115 if e: | 115 if err: |
116 sys.stderr.write('warning: could not establish Mercurial ' | 116 sys.stderr.write('warning: could not establish Mercurial ' |
117 'version:\n%s\n' % e) | 117 'version:\n%s\n' % err) |
118 else: | 118 else: |
119 l = l.split() | 119 l = out.split() |
120 while len(l) > 1 and l[-1][0].isalpha(): # remove non-numbered tags | 120 while len(l) > 1 and l[-1][0].isalpha(): # remove non-numbered tags |
121 l.pop() | 121 l.pop() |
122 if l: | 122 if l: |
123 version = l[-1] # latest tag or revision number | 123 version = l[-1] # latest tag or revision number |
124 if version.endswith('+'): | 124 if version.endswith('+'): |