summaryrefslogtreecommitdiff
path: root/pym
diff options
context:
space:
mode:
Diffstat (limited to 'pym')
-rw-r--r--pym/gentoolkit/eclean/clean.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/pym/gentoolkit/eclean/clean.py b/pym/gentoolkit/eclean/clean.py
index e00bcc0..c62abb9 100644
--- a/pym/gentoolkit/eclean/clean.py
+++ b/pym/gentoolkit/eclean/clean.py
@@ -139,6 +139,10 @@ class CleanUp(object):
# only count size if successfully deleted and not a link
if statinfo.st_nlink == 1:
clean_size += statinfo.st_size
+ try:
+ os.rmdir(os.path.dirname(file_))
+ except OSError:
+ pass
except EnvironmentError as er:
print( pp.error("Could not delete "+file_), file=sys.stderr)
print( pp.error("Error: %s" %str(er)), file=sys.stderr)