[Reproducible-commits] [debbindiff] 01/01: Remove temporary directory when exception is raised.

Reiner Herrmann deki-guest at moszumanska.debian.org
Thu Apr 9 14:44:11 UTC 2015


This is an automated email from the git hooks/post-receive script.

deki-guest pushed a commit to branch master
in repository debbindiff.

commit bc8e28e606019d1b306453cad57ec5c3e295b4e7
Author: Reiner Herrmann <reiner at reiner-h.de>
Date:   Thu Apr 9 16:43:02 2015 +0200

    Remove temporary directory when exception is raised.
    
    Closes: #782253
---
 debbindiff/comparators/utils.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/debbindiff/comparators/utils.py b/debbindiff/comparators/utils.py
index 9d34817..18ad66f 100644
--- a/debbindiff/comparators/utils.py
+++ b/debbindiff/comparators/utils.py
@@ -87,8 +87,10 @@ def binary_fallback(original_function):
 @contextmanager
 def make_temp_directory():
     temp_dir = tempfile.mkdtemp(suffix='debbindiff')
-    yield temp_dir
-    shutil.rmtree(temp_dir)
+    try:
+        yield temp_dir
+    finally:
+        shutil.rmtree(temp_dir)
 
 
 def get_ar_content(path):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/debbindiff.git



More information about the Reproducible-commits mailing list