Skip to content

Commit

Permalink
Merge pull request #1366 from JDWarner/mixed_permission_error
Browse files Browse the repository at this point in the history
FIX: Informative IOError if package installed w/mixed permissions.
  • Loading branch information
blink1073 committed Feb 4, 2015
2 parents 372ea53 + 7d5ed51 commit cd0a648
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,17 @@ def write_version_py(filename='skimage/version.py'):
version='%s'
"""

vfile = open(os.path.join(os.path.dirname(__file__),
filename), 'w')

try:
vfile = open(os.path.join(os.path.dirname(__file__),
filename), 'w')
vfile.write(template % VERSION)

except IOError:
raise IOError("Could not open/write to skimage/version.py - did you "
"install using sudo in the past? If so, run\n"
"sudo chown -R your_username ./*\n"
"from package root to fix permissions, and try again.")

finally:
vfile.close()

Expand Down

0 comments on commit cd0a648

Please sign in to comment.