Selaa lähdekoodia

Ignore errors when deleting GNUGPG home directory.

Sometimes these fail because of race conditions with gnupg agent socket files.

Fixes #1000

Thanks to Matěj Cepl for the patch.
Matěj Cepl 2 vuotta sitten
vanhempi
commit
d8a882709f
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      dulwich/tests/test_porcelain.py

+ 1 - 1
dulwich/tests/test_porcelain.py

@@ -277,7 +277,7 @@ ya6JVZCRbMXfdCy8lVPgtNQ6VlHaj8Wvnn2FLbWWO2n2r3s=
         super(PorcelainGpgTestCase, self).setUp()
         self.gpg_dir = os.path.join(self.test_dir, "gpg")
         os.mkdir(self.gpg_dir, mode=0o700)
-        self.addCleanup(shutil.rmtree, self.gpg_dir)
+        self.addCleanup(shutil.rmtree, self.gpg_dir, ignore_errors=True)
         self._old_gnupghome = os.environ.get("GNUPGHOME")
         os.environ["GNUPGHOME"] = self.gpg_dir
         if self._old_gnupghome is None: