Skip to content

Commit 6eac40d

Browse files
author
Mr. Outis
committed
system: catch OSError instead of Exception
1 parent e5bee24 commit 6eac40d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

dvc/system.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,14 @@ def copy(src, dest):
2424
def hardlink(source, link_name):
2525
try:
2626
os.link(source, link_name)
27-
return
28-
except Exception as exc:
27+
except OSError as exc:
2928
raise DvcException("failed to link") from exc
3029

3130
@staticmethod
3231
def symlink(source, link_name):
3332
try:
3433
os.symlink(source, link_name)
35-
return
36-
except Exception as exc:
34+
except OSError as exc:
3735
raise DvcException("failed to symlink") from exc
3836

3937
@staticmethod

0 commit comments

Comments
 (0)