]> granicus.if.org Git - python/commitdiff
Fix another ResourceWarning in test_packaging.
authorEzio Melotti <ezio.melotti@gmail.com>
Fri, 20 May 2011 17:27:54 +0000 (20:27 +0300)
committerEzio Melotti <ezio.melotti@gmail.com>
Fri, 20 May 2011 17:27:54 +0000 (20:27 +0300)
Lib/packaging/tests/pypi_server.py
Lib/packaging/tests/test_pypi_simple.py

index d22f5c3ab7818b769eda4084d4f4f59154403a51..6a72afbdca717ab7f49352d97900b6719efdf9d4 100644 (file)
@@ -149,7 +149,8 @@ class PyPIServer(threading.Thread):
     def stop(self):
         """self shutdown is not supported for python < 2.6"""
         self._run = False
-        self.join()
+        if self.is_alive():
+            self.join()
         self.server.server_close()
 
     def get_next_response(self):
index c43a8390fc8379aefe378a76415efc4c1e62e4bd..6f0d8d9d7b2361719df47b6b9b6747d89c2e99d7 100644 (file)
@@ -233,6 +233,7 @@ class SimpleCrawlerTestCase(TempdirManager,
             self.assertEqual(4, len(crawler.get_releases("foo")))
         finally:
             mirror.stop()
+            server.stop()
 
     def test_simple_link_matcher(self):
         # Test that the simple link matcher finds the right links"""