Skip to content

BLD: fixup setup.py, initialize pipe variable to None #5868

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
1 commit merged into from Jan 7, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ def build_extensions(self):
import subprocess
FULLVERSION += '.dev'

pipe = None
for cmd in ['git','git.cmd']:
try:
pipe = subprocess.Popen([cmd, "describe", "--always"],
Expand All @@ -210,15 +211,15 @@ def build_extensions(self):
except:
pass

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

# use result og git describe as version string
# use result of git describe as version string
FULLVERSION = rev.lstrip('v')

else:
Expand Down