Skip to content

Commit

Permalink
Merge pull request #448 from itofzo/delete_empty_folders_dev
Browse files Browse the repository at this point in the history
Fix delete_empty_folders. To iterate we need dirname not basename
  • Loading branch information
midgetspy committed Aug 18, 2012
2 parents c5c42df + fc663aa commit 3160ee2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sickbeard/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ def rename_ep_file(cur_path, new_path):

return True


def delete_empty_folders(check_empty_dir):
"""
Walks backwards up the path and deletes any empty folders found.
Expand All @@ -505,7 +506,8 @@ def delete_empty_folders(check_empty_dir):
except (WindowsError, OSError), e:
logger.log(u"Unable to delete "+check_empty_dir+": "+repr(e)+" / "+str(e), logger.WARNING)
break
check_empty_dir = os.path.basename(check_empty_dir)
check_empty_dir = os.path.dirname(check_empty_dir)


def chmodAsParent(childPath):
if os.name == 'nt' or os.name == 'ce':
Expand Down

0 comments on commit 3160ee2

Please sign in to comment.