diff options
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r-- | subcmds/sync.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index cc0b17e9..7ba9ebfc 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
@@ -487,7 +487,13 @@ later is required to fix a server side protocol bug. | |||
487 | dirs_to_remove += [os.path.join(root, d) for d in dirs | 487 | dirs_to_remove += [os.path.join(root, d) for d in dirs |
488 | if os.path.join(root, d) not in dirs_to_remove] | 488 | if os.path.join(root, d) not in dirs_to_remove] |
489 | for d in reversed(dirs_to_remove): | 489 | for d in reversed(dirs_to_remove): |
490 | if len(os.listdir(d)) == 0: | 490 | if os.path.islink(d): |
491 | try: | ||
492 | os.remove(d) | ||
493 | except OSError: | ||
494 | print('Failed to remove %s' % os.path.join(root, d), file=sys.stderr) | ||
495 | failed = True | ||
496 | elif len(os.listdir(d)) == 0: | ||
491 | try: | 497 | try: |
492 | os.rmdir(d) | 498 | os.rmdir(d) |
493 | except OSError: | 499 | except OSError: |