1
0
Fork 0
mirror of synced 2024-11-17 05:55:34 -05:00

Merge branch 'antaflos/force-symlinked-dirs'

This commit is contained in:
Anish Athalye 2015-04-27 17:03:40 -04:00
commit db8364490d

View file

@ -78,7 +78,9 @@ class Linker(Executor):
(self._exists(path) and not self._is_link(path))): (self._exists(path) and not self._is_link(path))):
fullpath = os.path.expanduser(path) fullpath = os.path.expanduser(path)
try: try:
if os.path.isdir(fullpath): if os.path.islink(fullpath):
os.unlink(fullpath)
elif os.path.isdir(fullpath):
shutil.rmtree(fullpath) shutil.rmtree(fullpath)
else: else:
os.remove(fullpath) os.remove(fullpath)