8000 Merge pull request #24511 from mattip/issue-24503 · numpy/numpy@07a2e85 · GitHub
[go: up one dir, main page]

Skip to content

Commit 07a2e85

Browse files
authored
Merge pull request #24511 from mattip/issue-24503
BUG: Use a default assignment for git_hash [skip ci]
2 parents 09925cf + 3123483 commit 07a2e85

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

numpy/_build_utils/gitversion.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def git_version(version):
2424
import subprocess
2525
import os.path
2626

27+
git_hash = ''
2728
try:
2829
p = subprocess.Popen(
2930
['git', 'log', '-1', '--format="%H %aI"'],
@@ -48,8 +49,6 @@ def git_version(version):
4849
# Only attach git tag to development versions
4950
if 'dev' in version:
5051
version += f'+git{git_date}.{git_hash[:7]}'
51-
else:
52-
git_hash = ''
5352

5453
return version, git_hash
5554

0 commit comments

Comments
 (0)
0