Permalink
Browse files

update _git_version_git() to better parse `git branch`

Sometimes, `git branch` may output in color, which causes the regex search to fail.  Specifying --color=never fixes this.
  • Loading branch information...
1 parent 68803af commit 46f00bbdfb04664ce0b46cfcf0b52c31773a1a8b @mikegoodspeed mikegoodspeed committed Aug 1, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 setup.py
View
@@ -269,7 +269,7 @@ def _get_version_git():
numbers[-2] += 1
name = '%s.%s.%s-beta%02d' % tuple(numbers)
- n, result = getoutput('git branch')
+ n, result = getoutput('git branch --color=never')
branch = re.search(r'\* (\w+)', result).group(1)
if branch != 'master' and not re.match('^v\d+$', branch):
name = branch + '-' + name

0 comments on commit 46f00bb

Please sign in to comment.