]> granicus.if.org Git - python/commitdiff
Issue #12167: Fix a reafleak in packaging.tests.PyPIServer constructor
authorVictor Stinner <victor.stinner@haypocalc.com>
Wed, 15 Jun 2011 21:58:57 +0000 (23:58 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Wed, 15 Jun 2011 21:58:57 +0000 (23:58 +0200)
Don't modify mutable default arguments...

Lib/packaging/tests/pypi_server.py

index cdff07c8f0e5385e6b864933e1089d20146937a8..2baf8ba91ec97722ffd0996edb68cb3c40950cc3 100644 (file)
@@ -88,7 +88,7 @@ class PyPIServer(threading.Thread):
     """
 
     def __init__(self, test_static_path=None,
-                 static_filesystem_paths=["default"],
+                 static_filesystem_paths=None,
                  static_uri_paths=["simple", "packages"], serve_xmlrpc=False):
         """Initialize the server.
 
@@ -105,6 +105,8 @@ class PyPIServer(threading.Thread):
         threading.Thread.__init__(self)
         self._run = True
         self._serve_xmlrpc = serve_xmlrpc
+        if static_filesystem_paths is None:
+            static_filesystem_paths = ["default"]
 
         #TODO allow to serve XMLRPC and HTTP static files at the same time.
         if not self._serve_xmlrpc: