mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-07 04:45:39 +00:00
Changed string formatting, raise OSError instead of Exception, and catch it in link to skip the current dotfile
This commit is contained in:
@@ -37,10 +37,10 @@ def get_tmpdir():
|
||||
def remove(path):
|
||||
''' Remove a file / directory / symlink '''
|
||||
if not os.path.exists(path):
|
||||
raise Exception("ERROR in remove: File not found: {}".format(path))
|
||||
raise OSError("File not found: %s" % path)
|
||||
if os.path.islink(path) or os.path.isfile(path):
|
||||
os.unlink(path)
|
||||
elif os.path.isdir(path):
|
||||
rmtree(path)
|
||||
else:
|
||||
raise Exception("Unsupported file type for deletion: {}".format(path))
|
||||
raise OSError("Unsupported file type for deletion: %s" % path)
|
||||
|
||||
Reference in New Issue
Block a user