This commit is contained in:
mcarton
2015-09-07 20:48:10 +02:00
parent 8bf4182f86
commit c3fe7e5e68
4 changed files with 23 additions and 8 deletions
+7 -2
View File
@@ -1,5 +1,5 @@
import os
import tarfile
import os
from thefuck import shells
from thefuck.utils import for_app
@@ -39,4 +39,9 @@ def get_new_command(command, settings):
def side_effect(old_cmd, command, settings):
with tarfile.TarFile(_tar_file(old_cmd.script)[0]) as archive:
for file in archive.getnames():
os.remove(file)
try:
os.remove(file)
except OSError:
# does not try to remove directories as we cannot know if they
# already existed before
pass