Skip to content

Commit

Permalink
Fix FileNotFoundError while trying to open /dev/null on Windows
Browse files Browse the repository at this point in the history
Fixes NifTK#233
  • Loading branch information
fepegar committed Feb 20, 2018
1 parent 45f310e commit 4270335
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions niftynet/utilities/versioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ def get_niftynet_git_version():
Return a version string based on the git repository,
conforming to PEP440
"""


import os
from subprocess import check_output

# Describe the version relative to last tag
command_git = ['git', 'describe', '--match', 'v[0-9]*']
version_buf = check_output(command_git,
stderr=open('/dev/null', 'w')).rstrip()
stderr=open(os.devnull, 'w')).rstrip()

# Exclude the 'v' for PEP440 conformity, see
# https://www.python.org/dev/peps/pep-0440/#public-version-identifiers
Expand Down

0 comments on commit 4270335

Please sign in to comment.