mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-01 20:07:06 +08:00
Merge pull request #1366 from JDWarner/mixed_permission_error
FIX: Informative IOError if package installed w/mixed permissions.
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user