mirror of
https://github.com/beetbox/beets.git
synced 2026-02-22 23:33:50 +01:00
use windows specific language for symlink exceptions
This now shows our original OS symlink error when Windows version < 6 (Vista) and also shows any other OS error that might be raised. This fixes #2114
This commit is contained in:
parent
65e38896ad
commit
21dbc9cbab
1 changed files with 7 additions and 4 deletions
|
|
@ -473,11 +473,14 @@ def link(path, dest, replace=False):
|
|||
os.symlink(path, dest)
|
||||
except NotImplementedError:
|
||||
# raised on python >= 3.2 and Windows versions before Vista
|
||||
raise FilesystemError(u'Windows XP does not support symbolic links.'
|
||||
raise FilesystemError(u'OS does not support symbolic links.'
|
||||
'link', (path, dest), traceback.format_exc())
|
||||
except OSError:
|
||||
raise FilesystemError(u'Operating system does not support symbolic '
|
||||
u'links.', 'link', (path, dest),
|
||||
except OSError as exc:
|
||||
# TODO: Windows version checks can be removed for python 3
|
||||
if hasattr('sys', 'getwindowsversion'):
|
||||
if sys.getwindowsversion()[0] < 6: # is before Vista
|
||||
exc = u'OS does not support symbolic links.'
|
||||
raise FilesystemError(exc, 'link', (path, dest),
|
||||
traceback.format_exc())
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue