clean: properly handle removing symbolic links
This commit is contained in:
1 parent
ab839658ba
commit
0ccc15089b
1 file changed
+3
-1
@@ -1702,7 +1702,9 @@ def clean_h(argv, svn, out, config):
|
|||||||
if dry_run:
|
if dry_run:
|
||||||
out.write("Would remove %s\n" % cp)
|
out.write("Would remove %s\n" % cp)
|
||||||
if force:
|
if force:
|
||||||
if os.path.isdir(cp):
|
if os.path.islink(cp):
|
||||||
|
os.unlink(cp)
|
||||||
|
elif os.path.isdir(cp):
|
||||||
shutil.rmtree(cp)
|
shutil.rmtree(cp)
|
||||||
elif os.path.isfile(cp):
|
elif os.path.isfile(cp):
|
||||||
os.unlink(cp)
|
os.unlink(cp)
|
||||||
|
|||||||
Reference in new issue
Block a user