From: Oleg Broytman Date: Thu, 7 May 2020 22:29:28 +0000 (+0300) Subject: Feat: Replace outdated `os.removedirs` by `shutil.rmtree` X-Git-Tag: 3.1.0~7 X-Git-Url: https://git.phdru.name/?p=mimedecode.git;a=commitdiff_plain;h=da12763f95358de314a5a50b84f628b473213336 Feat: Replace outdated `os.removedirs` by `shutil.rmtree` --- diff --git a/mimedecode/mimedecode.py b/mimedecode/mimedecode.py index ead1ab3..bdc44c1 100644 --- a/mimedecode/mimedecode.py +++ b/mimedecode/mimedecode.py @@ -1,6 +1,7 @@ """Decode MIME message""" import os +import shutil import subprocess import sys @@ -528,4 +529,4 @@ def open_output_file(filename): return open(fullpath, 'wb') except Exception: if create: - os.removedirs(full_dir) + shutil.rmtree(full_dir)