Skip to content

Commit b336526

Browse files
committed
Fixed package version
1 parent 2248a08 commit b336526

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

graphql/pyutils/version.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ def get_version(version=None):
2121
git_changeset = get_git_changeset()
2222
if git_changeset:
2323
sub = '.dev%s' % git_changeset
24-
24+
else:
25+
sub = '.dev'
2526
elif version[3] != 'final':
2627
mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'rc'}
2728
sub = mapping[version[3]] + str(version[4])
@@ -64,14 +65,14 @@ def get_git_changeset():
6465
so it's sufficient for generating the development version numbers.
6566
"""
6667
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]
7368
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]
7475
timestamp = datetime.datetime.utcfromtimestamp(int(timestamp))
75-
except ValueError:
76+
except:
7677
return None
7778
return timestamp.strftime('%Y%m%d%H%M%S')

0 commit comments

Comments
 (0)