diff options
-rw-r--r-- | obnamlib/encryption.py | 2 | ||||
-rw-r--r-- | obnamlib/encryption_tests.py | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/obnamlib/encryption.py b/obnamlib/encryption.py index 45611401..35ac1da2 100644 --- a/obnamlib/encryption.py +++ b/obnamlib/encryption.py @@ -180,7 +180,7 @@ class Keyring(object): ''', gpghome=self._gpghome) def _cleanup(self): - shutil.rmtree(self._gpghome) + shutil.rmtree(self._gpghome, ignore_errors=True) self._gpghome = None @property diff --git a/obnamlib/encryption_tests.py b/obnamlib/encryption_tests.py index 86fd2fa0..fc795fad 100644 --- a/obnamlib/encryption_tests.py +++ b/obnamlib/encryption_tests.py @@ -41,7 +41,7 @@ class SymmetricEncryptionTests(unittest.TestCase): self.gpghome = tempfile.mkdtemp() def tearDown(self): - shutil.rmtree(self.gpghome) + shutil.rmtree(self.gpghome, ignore_errors=True) def test_generates_key_of_correct_length(self): numbits = 16 @@ -112,7 +112,7 @@ class GetPublicKeyTests(unittest.TestCase): self.keyid = '1B321347' def tearDown(self): - shutil.rmtree(self.dirname) + shutil.rmtree(self.dirname, ignore_errors=True) def test_exports_key(self): key = obnamlib.get_public_key(self.keyid, gpghome=self.gpghome) @@ -189,7 +189,7 @@ class PublicKeyEncryptionTests(unittest.TestCase): self.keyid = '1B321347' def tearDown(self): - shutil.rmtree(self.dirname) + shutil.rmtree(self.dirname, ignore_errors=True) def test_roundtrip_works(self): cleartext = 'hello, world' |