Skip to content

Commit 5adbb88

Browse files
committed
fix commit hash reading in PY3
1 parent 3e7dd7f commit 5adbb88

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,13 @@ def run(self):
7070
shell=True)
7171
repo_commit, _ = proc.communicate()
7272
# Fix for python 3
73-
repo_commit = '{}'.format(repo_commit)
73+
if PY3:
74+
repo_commit = repo_commit.decode()
75+
7476
# We write the installation commit even if it's empty
7577
cfg_parser = ConfigParser()
7678
cfg_parser.read(pjoin('nipype', 'COMMIT_INFO.txt'))
77-
cfg_parser.set('commit hash', 'install_hash', repo_commit)
79+
cfg_parser.set('commit hash', 'install_hash', repo_commit.strip())
7880
out_pth = pjoin(self.build_lib, 'nipype', 'COMMIT_INFO.txt')
7981
if PY3:
8082
cfg_parser.write(open(out_pth, 'wt'))

0 commit comments

Comments
 (0)