Compare commits

...
3 Commits
Author SHA1 Message Date
Ruslan Kuprieiev bc711417cd dvc: update to 0.19.15 2018-10-23 03:13:54 +03:00
Ruslan Kuprieiev 5654fc269c Merge pull request #1254 from efiop/master
system: catch link exceptions
2018-10-23 02:37:58 +03:00
Ruslan Kuprieiev b415ae9a21 system: catch link exceptions
Signed-off-by: Ruslan Kuprieiev <[email protected]>
2018-10-22 22:44:33 +03:00
2 changed files with 11 additions and 4 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ import os
import warnings
VERSION_BASE = '0.19.14'
VERSION_BASE = '0.19.15'
__version__ = VERSION_BASE
PACKAGEPATH = os.path.abspath(os.path.dirname(__file__))
+10 -3
View File
@@ -12,8 +12,11 @@ class System(object):
from dvc.exceptions import DvcException
if System.is_unix():
os.link(source, link_name)
return
try:
os.link(source, link_name)
return
except Exception as exc:
raise DvcException('link', cause=exc)
CreateHardLink = ctypes.windll.kernel32.CreateHardLinkW
CreateHardLink.argtypes = [ctypes.c_wchar_p,
@@ -31,7 +34,11 @@ class System(object):
from dvc.exceptions import DvcException
if System.is_unix():
return os.symlink(source, link_name)
try:
os.symlink(source, link_name)
return
except Exception as exc:
raise DvcException('symlink', cause=exc)
flags = 0
if source is not None and os.path.isdir(source):