@@ -21,7 +21,8 @@ def get_version(version=None):
21
21
git_changeset = get_git_changeset ()
22
22
if git_changeset :
23
23
sub = '.dev%s' % git_changeset
24
-
24
+ else :
25
+ sub = '.dev'
25
26
elif version [3 ] != 'final' :
26
27
mapping = {'alpha' : 'a' , 'beta' : 'b' , 'rc' : 'rc' }
27
28
sub = mapping [version [3 ]] + str (version [4 ])
@@ -64,14 +65,14 @@ def get_git_changeset():
64
65
so it's sufficient for generating the development version numbers.
65
66
"""
66
67
repo_dir = os .path .dirname (os .path .dirname (os .path .abspath (__file__ )))
67
- git_log = subprocess .Popen (
68
- 'git log --pretty=format:%ct --quiet -1 HEAD' ,
69
- stdout = subprocess .PIPE , stderr = subprocess .PIPE ,
70
- shell = True , cwd = repo_dir , universal_newlines = True ,
71
- )
72
- timestamp = git_log .communicate ()[0 ]
73
68
try :
69
+ git_log = subprocess .Popen (
70
+ 'git log --pretty=format:%ct --quiet -1 HEAD' ,
71
+ stdout = subprocess .PIPE , stderr = subprocess .PIPE ,
72
+ shell = True , cwd = repo_dir , universal_newlines = True ,
73
+ )
74
+ timestamp = git_log .communicate ()[0 ]
74
75
timestamp = datetime .datetime .utcfromtimestamp (int (timestamp ))
75
- except ValueError :
76
+ except :
76
77
return None
77
78
return timestamp .strftime ('%Y%m%d%H%M%S' )
0 commit comments