Skip to content

Commit a5d361f

Browse files
author
y-p
committed
BLD: fixup setup.py, initialize pipe variable to None
1 parent 52a82ef commit a5d361f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ def build_extensions(self):
200200
import subprocess
201201
FULLVERSION += '.dev'
202202

203+
pipe = None
203204
for cmd in ['git','git.cmd']:
204205
try:
205206
pipe = subprocess.Popen([cmd, "describe", "--always"],
@@ -210,15 +211,15 @@ def build_extensions(self):
210211
except:
211212
pass
212213

213-
if pipe.returncode != 0:
214+
if pipe is None or pipe.returncode != 0:
214215
warnings.warn("WARNING: Couldn't get git revision, using generic version string")
215216
else:
216217
rev = so.strip()
217218
# makes distutils blow up on Python 2.7
218219
if sys.version_info[0] >= 3:
219220
rev = rev.decode('ascii')
220221

221-
# use result og git describe as version string
222+
# use result of git describe as version string
222223
FULLVERSION = rev.lstrip('v')
223224

224225
else:

0 commit comments

Comments
 (0)