1 |
On 12/4/19 6:12 PM, Matt Turner wrote: |
2 |
> Closes: https://bugs.gentoo.org/671592 |
3 |
> Signed-off-by: Matt Turner <mattst88@g.o> |
4 |
> --- |
5 |
> pym/gentoolkit/eclean/clean.py | 4 ++++ |
6 |
> 1 file changed, 4 insertions(+) |
7 |
> |
8 |
> diff --git a/pym/gentoolkit/eclean/clean.py b/pym/gentoolkit/eclean/clean.py |
9 |
> index b790de0..89300ce 100644 |
10 |
> --- a/pym/gentoolkit/eclean/clean.py |
11 |
> +++ b/pym/gentoolkit/eclean/clean.py |
12 |
> @@ -139,6 +139,10 @@ class CleanUp(object): |
13 |
> # only count size if successfully deleted and not a link |
14 |
> if statinfo.st_nlink == 1: |
15 |
> clean_size += statinfo.st_size |
16 |
> + try: |
17 |
> + os.rmdir(os.path.dirname(file_)) |
18 |
> + except OSError as er: |
19 |
> + pass |
20 |
> except EnvironmentError as er: |
21 |
> print( pp.error("Could not delete "+file_), file=sys.stderr) |
22 |
> print( pp.error("Error: %s" %str(er)), file=sys.stderr) |
23 |
> |
24 |
|
25 |
Looks good except you can omit " as er" since it's unused. |
26 |
-- |
27 |
Thanks, |
28 |
Zac |